A conducting tip is brought very cloes to the surface, and a voltage is applied which causes electrons to tunnel through the vacuum. The current is a function of tip position, applied voltage, and the local density of states in the sample. STM requires very clean and stable surfaces, sharp tips, and good vibration control.