The scanner moves the probe over the sample (or the sample under the probe) and must be able to control the position extremely accurately. In most AFMs piezoelectric materials are used to achieve this. These change dimensions with an applied voltage. The diagram below shows a typical scanner arrangement, with a hollow tube of piezoelectric material and the controlling electrodes attached to the surface.
Diagram of a typical piezo scanner (cut into two parts). Separate pairs of electrodes control movement in the x, y and z directions