The secondary electron generation process is studied in an ultra-high vacuum scanning transmission electron microscope using electron coincidence spectroscopy. Production pathways for secondary electrons are determined by analyzing coincidences between secondary electrons and individual excitation events. The ultimate spatial resolution available in scanning electron microscopy is limited by the delocalization of the secondary electron generation process. This delocalization is studied using momentum resolved coincidence electron spectroscopy. The fraction of secondary electrons resulting from localized excitations can explain the high spatial resolution observed in secondary electron microscopy images.