Bats listen for the return of the sound wave (the echo) to work out how far away things are.
The longer the sound wave takes to return, the further away the object is.
This is called echolocation.
Dolphins and whales also use echolocation to find food underwater.
Submarines and self-driving cars use echolocation too, but in these situations it is called sonar.