Enabling the high metabolic flux required to fly. As the only flying mammals, bats have the highest metabolism among mammals while also being more biologically compatible with us compared to e.g. birds.
A rather suboptimal evolutionary path - birds are way better adapted to flight at lower cost but then again they had a 100 million year head start (theropod dinosaurs) compared to bats.
Birds can extract more oxygen from each breath compared to bats - besides lungs they have additional air "storage" places called air sacs in their body.
Their lungs do not contract like mammals but the air sacs do - so when they exhale their lungs are still performing a gas exchange.
Being able to move your arms a bazillion times by second for hours and hours. It means finding how to pump an awful lot of sugar and oxygen to that muscles.