The basic principle of scanning tunneling microscopy (STM) is based on the tunneling current between a metallic tip, which is sharpened to a single atom point and a conducting material.
A small bias voltage (mV to 3 V) is applied between a atomically sharp tip and the sample. If the distance between the tip and the sample is large no current flow. However, when the tip is brought very close ( 10 Å) without physical contact, a current (pA to nA) flows across the gap between the tip and the sample.
Such current is called tunneling current which is the result of the overlapping wavefunctions between the tip atom and surface atom, electrons can tunnel across the vacuum barrier separating the tip and sample in the presence of small bias voltage.
The magnitude of tunneling current is extremely sensitivity to the gap distance between the tip and sample, the local density of electronic states of the sample and the local barrier height. The density of eletronic states is the amount of electrons exit at specific energy. As we measure the current with the tip moving across the surface, atomic information of the surface can be mapped out.
Here is a STM image showing iron atoms adsorb on a copper (111) surface forming a "quantum corral"in a very low temperature (4K). Actually, the image shows the contour of the local density of electron states. The corral is about 14.3 nm in diameter.