We use other magnetic lenses to push the electron beam backwards and forwards across the surface. This is how we build up an image of the sample. This is the scanning part of scanning electron microscopy.