How is it that, bats are able to fly at night without colliding with other objects?

Bats search out prey and fly at night by emitting and detecting reflections of ultrasonic waves.
Bats emit high frequency ultrasonic squeaks while flying and listen to the echoes produced by reflection of their squeaks from the obstacle, prey or object in their path. From the time taken by the echo to be heard, bats can determine the distance of the object and can avoid the object by changing the direction without colliding with it.