EDS works by directing a beam of X-rays at the sample. When the X-rays interact with the sample, they can knock electrons out of their atomic orbits. This electron displacement results in the emission of X-rays from the sample at unique energy levels that are characteristic of the elements present. The energy dispersive spectrometer measures these X-rays and uses this data to determine the elemental composition of the sample.