Sonar is an acronym for Sound Navigation and Ranging. It is a method that uses high-frequency sound waves to communicate or detect objects.
Submarines use sonar for the reasons stated above. There are two types of sonar that submarines may use. Passive sonar is listening and detecting sound waves created by other objects. Active sonar is creating the sound waves and listening for echos. Submarines have used active sonar to detect the amount of time it takes for sound waves to return to the ship at different locations along the sea floor. This data can be generated into maps of the seafloor.
Dolphins and bats use a form of sonar called echolocation. The animals transmit high-frequency sound waves. The animals can detect how far away an item is based on the length of time it takes the sound waves to reflect off of a surface and return to them. In this way, the animals can located each other, food, or steer clear of predators.