SEMs function by directing a tightly focused electron beam onto the sample surface. When the electrons interact with the sample, they generate various signals, including secondary electrons, backscattered electrons, and X-rays. These signals are collected and processed to create detailed images and elemental compositions of the sample. The ability to manipulate the electron beam precisely allows SEMs to achieve resolutions down to a few nanometers.