First, what exactly is sound? Air particles are constantly in motion, and their vibrations cause very small variations in pressure. When an object vibrates, it causes further changes in the air pressure and creates a sound wave, which travels out from the source of the sound (much like ripples in water). The speed of the wave is determined by the substance through which it is traveling. For example, sound travels through air faster than it does through water. As sound waves travel, they gradually lose energy and become less intense. If an object gets in the way of the sound wave, the sound wave bounces off of it and loses strength.
Volume, sound quality, and processing time lags are the primary means by which we determine the direction of sound. For instance, sound coming from one direction will reach the ear furthest away about 1/500 of a second later than the closer ear, and the brain can detect this tiny time difference to determine whether a sound is coming from the left or right. We can also tell the direction of high-frequency sounds better than low- frequency sounds. This is because high-frequency sounds are blocked by the head and do not easily reach the far ear, causing a slightly higher volume in the near ear. The head cannot block the sound as easily in low-frequency waves.
Some animals such as bats and dolphins use sound to measure distance as well as direction. They emit very short chirps and from the sounds that are reflected back, are able to estimate the distance of an object. Bats can obtain even more information from sound. They are able to tell the direction of an object by comparing the sound detected from its two ears, and can also tell is the object is hard (an obstacle) or soft (potential prey) by comparing the frequencies.