Our ears react to changes in air pressure. We can hear the noise only if it vibrates in 20 - 20,000 Hz per second. To which ear the sound wave came first. How much time it took to wave sound to appear in the other ear.
Brain compares the level of sound wave to a table based on life time experience.
Knowing this information, brain tells us where the noise comes from. Distance between ears is about 25 cm. If a noise comes directly from left or right, it takes less then 0.001 of a second to reach the other ear, if a noise comes from somewhere between the ears, it takes less time until it reaches the second ear. And it's amazing because our hearing system doesn't deal with one sound at a time - but with many different kind of noises at the same time. Hearing system is much more accurate then any electronic measuring system we know - but many of us rely on outcome of such instruments when buying a stereo system.