An in-depth explanation of AFM theory is outside the scope of this FAQ but, briefly: an AFM is analogous to a surface profiler, where a sharp tip is dragged over the sample, and the movement of the tip is monitored as a measure of sample topography.

However, in AFM, the tip is mounted on a reflective cantilever (the cantilever and tip together are known as the probe). The deflection of the tip is measured by laser, reflected off the cantilever onto a split photodiode. This allows vertical and horizontal measurement of the cantilever bending. The vertical deflection data tells us about the interaction between the tip and the sample.

The cantilever deflection information is fed back into the scanner- the part that moves the probe over the sample. If the tip is bending up because the tip has reached a feature, the scanner moves the whole probe upwards, enough to return the deflection of the cantilever to its original value. Likewise, when a "valley" is encountered, the scanner moves the probe downwards. In this way, the deflection of the cantilever, and hence the tip-sample interaction force is kept constant.

The amount the scanner had to move to maintain the deflection is equivalent to sample topography, and is recorded by the computer. This is contact-mode AFM.