What is the evolutionary explanation for bat's echolocation
The main reason for bats to "develop" their echolocation system was the avalability of an almost empty niche: Hunting insects at night. Birds are not able to hunt without light and here is where the bats come in. They are able to hunt at night and also to live and orientate in environments where they are protected over the day: Caves. Bats at night are also protected from predatory birds.

There is are a few interesting sources if you want to dive deeper into the stuff:


The evolution of flight and echolocation in bats: another leap in
the dark
Echolocation in bats
Evolutionary aspects of bat echolocation