They only came to get Sam and Frodo out after the ring had been destroyed and Sauron’s forces significantly weakened. They couldn’t have flown into Mordor before because Sauron and his armies were too strong and it would have been too dangerous to fly under heavy attack from the ground.