As the electron beam hits each spot on the sample, secondary electrons are knocked loose from its surface. A detector counts these electrons and sends the signals to an amplifier.