The AFM tip interacts with the surface of the sample via Van der Waals forces, electrostatic forces, and other interactions. As the tip scans across the surface, it deflects due to these interactions. A laser beam is focused on the back of the cantilever, and the reflection of the laser beam is captured by a photodetector. Changes in the position of the laser spot on the photodetector are used to create a topographical map of the surface.