The beam of electrons hits the sample. Some of the electrons in the beam bounce back from the sample. Because the sample is made up of atoms some new electrons also come off it as well.