Energy Dispersive X-ray Spectroscopy (EDS) works by bombarding a sample with a focused beam of electrons. This interaction causes the emission of X-rays, which are characteristic of the elements present in the sample. By measuring the energy and intensity of these X-rays, the elemental composition can be determined.