Used by the Royal Navy to search for and classify submarines. Or if you hug trees used to kill innocent whales and dolphin, who are supposed to be so cleaver they should fall for such a simple mistake.
Two types – Active and Passive.
Active is used by trained chimps who press a button and “ping” there is your target. Used mostly by the RN Helicopters, as said mostly trained chimps. The new sonar on the Merlin is widely regarded as the worlds best and is actually feared by submariners. The ultimate active sonar is US. It works by using so much power underwater anything still moving within 10nm has to be man made. This has upset the tree huggers. Oh yes and used for minehunting and fish finding, fish finding not normally done by the Navy.
Passive is for real men. Using dark arts passed down from matelot generation to generation (webbed feet a dead give-a-way) ... you listen using very expensive equipment to the sounds of the sea. The operator does listen in the traditional sense, instead the sound waves are seen via a waterfall display. By matching the lines on the screen with known data a good operator can identify a sub or ship by the sound their propellers in the water make.
Sonar ratings in the Navy tend to be lonely people who talk about db’s and TPK. They have few friends and are generally ridiculed by the Gunners.