Bat echolocation is a perceptual system where ultrasonic sounds are emitted specifically to produce echoes. By comparing the outgoing pulse with the returning echoes, the brain and auditory nervous system can produce detailed images of the bat's surroundings. This allows bats to detect, localize, and even classify their prey in complete darkness. – Echolocation, Wikipedia
Furthermore, we read that:
[ . . . ] these bats contract their middle ear muscles when emitting a call, so they can avoid deafening themselves.
So far, so good. But this gives rise to two questions I've been challenging with. (And unfortunately I seem not to be able to find the correct search terms and I don't get relevant results)
Imagine two bats close together, flying in a distance of, say, 1 meter from each other. As we know, both echolocate in order to perceive the whereabouts of their surroundings. Bat #1 emits ultrasonic waves, but contracts its middle ear muscles so it won't get hurt. I imagine these two bats are close enough to each other for the waves to be harmful to bat #2's hearing as well.
Hence, two problems arise
Either the waves aren't harmful to the other one (I'd love some calculations on this, or hints on how to do some myself) or something's happening to bat #2 that doesn't let the ultrasonic waves damage its hearing. Certainly bat #2 isn't supposed to know when #1 will emit those waves, so what is happening?
Won't the waves bat #1 has emitted affect the waves bat #2 will emit? So, won't this affect bat #2's perception? We've seen many bats flying together in real life with [maybe seemingly] no trouble visualizing the surroundings, so this mustn't be the case, but why?