The working principle of the STM is based on the concept of quantum tunneling. When the probe is brought extremely close to the sample surface, electrons can tunnel through the vacuum between the probe and the surface. This tunneling current is highly sensitive to the distance between the probe and the sample, allowing the STM to achieve atomic resolution. By scanning the probe over the sample and recording the tunneling current, a three-dimensional image of the surface can be constructed.