Let's start by hiding all but one row of sample atoms.
Now, if we apply a negative voltage to the tip, electrons will try to jump off of it to the sample. But this "quantum mechanical tunneling" can only occur over distances of a few atomic diameters.
So if we move the tip downward, the tunneling current will diminish when sample atoms are farther away, and increase when they are closer.
We could use these changes in current to record the atomic shape of the sample surface - but how would we make sure that the tip moved in a straight line parallel to the sample surface?