Echolocation, which is also known as biosonar, is a technique used by several animals that utilizes sound waves to investigate the world around them. The basic principle behind echolocation is fairly simple. Using a type of naturally produced sonar, an animal sends out sound waves that then hit a particular object and then bounces back.
Timing the lapse in between the sending and receiving of the sound tells an animal how far away an object is. Kind of like the way that we were taught to count the time lapse in between hearing the thunder and seeing the lightening when we were children. The longer the amount of time in between the two events, the further away an object is. The shorter the lapse, the closer the object.
Since sound waves will hit and reflect an object in parts, based on its shape or angle, this can also help to give an animal a sense of not only how far away an object is, but the general shape and positions of the object as well. The illustration below gives you a fairly good idea of this simple process works.

click to enlarge
Animal & Human Applications
The use of biosonar, as you might suspect, is very similar to the techniques used by submarines and other vessels for navigation and detection of other vessels in the area. It has been adapted by a variety of different mammals including dolphins, whales, bats, shrews, and even humans who use this master of sound to help them "see" their way around even in extreme environments of total darkness and murky waters. In fact, the use of echolocation has become so prominent in some animals that it helps to regulate a major portion of their lives and without it, they would be unable to survive in their environments.