About 65 million years ago, is the accepted estimate for when bat echolocation first appeared on the scene. This was the beginning of a long and protracted arms race between the bat hunters, and the hunted, the insects. For a bat, the nocturnal insects of choice are the moths. Plentiful, and with large fat bodies which make them quite attractive. It helps that they are also easy to find; their wings are great reflectors of the ultrasonic frequencies that bats use to find them, flagging them up against the clutter in a bats sonic world.
Way back in evolutionary time, the moths responded to their new predators. In the beginning simply, by evading the bat attacks with crazy evasive diving maneuvers. Then, with more sophisticated methods; ears that were tuned with great precision and sensitivity to the bats very high pitched cries. The very echolocation cries that the bats used to find moths now immediately alerted their prospective prey to their presence.The moths could now dive and circle away well in advance of the swooping bat.
In response, the bats called more softly, they started whispering, and changing the pitch signatures of their calls. They tried their very best to make echolocation calls that the moths could not easily detect or discriminate the direction of. The moths kept up their part of the race too, the pressure not to become supper being quite high. They changed the shape of their wings so their main body would not be attacked and just the edges of their wings would be taken. Some even started making sounds of their own! Sounds that either jammed bat sonar or made them sound unappetising, the acoustic equivalent of very red berries. And in return, its seems that some bats have responded by finding prey by the sounds of the prey alone and silencing their echolocation calls. And so, on it goes.
And on goes the research, starting with the work of Brock Fenton, way back in the late 70's, right up to today with many different groups still working on different aspects of the same behaviour and ecology! Including the work of fellow post-doc Holger Goerlitz, who helped me do this beast. If you want to know still more about this cool co-evolutionary arms race, you could do worse than read this lovely review (if you can get behind the paywall).