SEM, short for scanning electron microscopy, uses an extremely focused beam of electrons to scan the surface of a sample, whereas TEM, short for transmission electron microscopy, passes electrons through a sample. The image formed in both cases depends on the interactions between the sample and the incident electrons.
The electrons generated for both types of electron microscope are generated by an electron gun. Thermoionic guns heat a metal wire to temperatures sufficient for ionization, then attract and accelerate electrons using a high, positive electric potential. Field emission guns extract electrons from a cold metal or ceramic sample directly, using a high electric field in conjunction with an ultra-high vacuum. Field emission guns give higher beam brightness, improving the final image quality. The electrons are then focused using condenser lenses, which use powerful electromagnets to focus the electrons in a small point. In scanning electron microscopy, the objective lens precedes the sample in the beam path, doing the final focusing of the beam at the sample surface. In transmission electron microscopy, the beam passes through the sample and is magnified by an objective lens succeeding the sample in the beam path. Scanning electron microscopes also have roster scanners to deflect and scan the beam over the sample surface.