For example, a scanning electron microscope has multiple condensers that "focus" the beam into a smaller spot size. How does a condenser actually change the direction of electron flow in a non-uniform way (off-center electrons get shifted more than electrons that are closer to the center of the beam)?
I'm not actually familiar with the construction of these microscopes, but most devices using focused charged-particle beam rely on quadrupole magnets1 to maintain the control of the beam size and shape.
It is worth noting that a quadrupole that focsuses the beam in one plane tends to de-focus it in an orthogonal plane, but by using sets of multiple quadrupoles it is possible to control the beam spread in all directions.
1 Four magnets arranged at right angles in a plane normal to the beam, with two opposed magnets showing their north poles and the other two showing their south poles. This arrangement has zero field at the center and stronger field further from the center: just what you want to allow the core of the beam to continue while adjusting the halo.
The magnetic lenses used in electron microscopy look very different from those used for particles accelerators (where quadrupole magnets are common) and actually focus all directions symmetrically:
The lens consists of a coil inside a doughnut mantle shaped ferromagnet. Therefore the magnetic field strength is highest close to the doughnut and decreases towards the center. In the focusing region at the center, the ideal field has a maximum at the center-plane. Thereby off-center electrons can be imagined as being pushed sideways before the center plane, inwards at the center plane and their sideways-motion being reversed behind the center plane. (Similar to how magnetic mirrors work, simply not strong enough to reverse their flight-path.)
Though this type of magnetic lens is very simple and focuses both directions at once, it has quite high spherical aberration, since the field at the edge has it's maximum above and below the central plain. That requires the magnet to be quite far away from the particle beam, which makes the lens quite inefficient and virtually unusable in particle accelerators. Multipole magnets have much lower spherical aberration and can be built smaller and more efficiently.