The AFM tip works by approaching the sample surface to within a few nanometers. As the tip scans the surface, it experiences forces such as van der Waals forces, electrostatic forces, and mechanical contact. Changes in these forces cause deflections in the cantilever, which are detected by a laser beam reflected off the cantilever into a photodetector. The deflection data are then converted into a high-resolution image of the sample surface.