SOund NAvigation and Ranging, sonar uses the sound transmission properties of water to detect and locate objects and obstacles under the water. Active sonar sends out a sound impulse called a ping and listens for the returning signal that has bounced off of things like submarines, surface ships, and the air-water boundary of the surface. Passive sonar just listens for noise, like engine and screw noise of other ships and subs, and other people's active sonar. Thermoclines serve as a kind of sound dampener, so that two subs on either side of a thermocline might not hear each other.
Things that use sonar include submarines, sonar bouys, torpedos, and surface ships. Subs have both active and passive sonar; I think they have some of their passive sonar in something called a towed sonar array. Torps only have active sonar, as do sonar bouys.