AFM probes work by scanning the sharp tip across the surface of a sample. The interaction between the tip and the sample causes the cantilever to deflect. This deflection is then measured using a laser beam reflected off the back of the cantilever into a photodetector. The resulting data provides detailed information about the sample's topography and other properties.