At night, bats fly to hunt insects and other small animals. However, during the day, they barely move at all. Bats sleep all day hanging upside down in secluded places, such as cave roofs, the underside of bridges, or inside hollow trees. According to How Stuff Works, there are actually several reasons why bats sleep upside down.
Sleeping upside down is the ideal position for bats to help them fly. Unlike birds, these flying mammals cannot launch into the air directly from the ground. A bat's wings cannot lift its body. In addition, a bat's hind legs are very small and underdeveloped, so they cannot run to build up speed for takeoff. Instead, bats use their front claws to climb to a high place, then fly. By sleeping upside down in a high location, this helps bats be ready to fly whenever they need to leave the roost. Sleeping upside down is also the best way to hide from danger. When most predators are active, especially birds of prey, bats will gather together. This makes predators unable to reach them. Sleeping upside down and clustering together allows bats to disappear from the world until night comes.
(Quoted from kompas.com)
The word they in sentence refers to ....