SEMs work by producing a beam of electrons that is focused on the specimen by a condenser and electromagnets. The beam is passed back and forth across a portion of the specimen. The e- are scattered by the specimen and the scattered electrons are detected and a 3D image is produced.