They have enough energy to fly because, Birds have a very strong heart and an efficient way of breathing. And, these are necessary for birds to fly. Birds also use a lot of energy while flying and need to eat a lot of food to power their flight.
If it doesn't answer your question. Don't hesitate to comment your opinion below!