In the book
The Eagles were already present for the battle itself, where they were instrumental in fighting the Nazgûl.
There came Gwaihir the Windlord, and Landroval his brother, greatest of all the Eagles of the North, mightiest of the descendants of old Thorondor, who built his eyries in the inaccessible peaks of the Encircling Mountains when Middle-earth was young. Behind them in long swift lines came all their vassals from the northern mountains, speeding on a gathering wind. Straight down upon the Nazgûl they bore, stooping suddenly out of the high airs, and the rush of their wide wings as they passed over was like a gale.
The Lord of the Rings - Book V, Chapter 4 - "The Field of Cormallen"
Gandalf then asks Gwaihir to take his brother Landroval and whoever else can fly fast, emphasizing the need for speed. Gwaihir thus brings Meneldor because he was young and fast. (And every mention of him is accompanied by a description of his speed, e.g. "Meneldor young and swift", "Meneldor the swift".)
‘Then come, and let your brother go with us, and some other of your folk who is most swift! For we have need of speed greater than any wind, outmatching the wings of the Nazgûl.’
‘The North Wind blows, but we shall outfly it,’ said Gwaihir. And he lifted up Gandalf and sped away south, and with him went Landroval, and Meneldor young and swift. And they passed over Udûn and Gorgoroth and saw all the land in ruin and tumult beneath them, and before them Mount Doom blazing, pouring out its fire.
The Lord of the Rings - Book V, Chapter 4 - "The Field of Cormallen"
Gandalf already has a relationship with Gwaihir, and Gwaihir and Landroval would also have the most experience, as both of them are very old Eagles dating back to the First Age.
Thus the quest of the Silmaril was like to have ended in ruin and despair; but in that hour above the wall of the valley three mighty birds appeared, flying northward with wings swifter than the wind. Thorondor was their leader; and with him were his mightiest vassals, wide-winged Lhandroval, and Gwaihir the lord of storm.
"Of Beren and Luthien", Tolkien's final 1951 version, reconstructed from the published Silmarillion and from Christopher's notes in The Lost Road (p.301) and Sauron Defeated (p.45)
So it seems that the eagles that went were specifically picked to increase the chance of some of them getting there in time and finding Frodo and Sam. More Eagles would make this easier, but would delay setting out, so just a handpicked three went.
It can also be suggested that three Eagles were needed to carry the three people: Gandalf, Frodo, and Sam. But the text is ultimately unclear about which Eagle carries each person. Gwaihir, carrying Gandalf, is the one who first sees Frodo and Sam, but then all three eagles fly down to meet them, and no further details are given.
And so it was that Gwaihir saw them with his keen far-seeing eyes, as down the wild wind he came, and daring the great peril of the skies he circled in the air: two small dark figures, forlorn, hand in hand upon a little hill, while the world shook under them, and gasped, and rivers of fire drew near. And even as he espied them and came swooping down, he saw them fall, worn out, or choked with fumes and heat, or stricken down by despair at last, hiding their eyes from death.
Side by side they lay; and down swept Gwaihir, and down came Landroval and Meneldor the swift; and in a dream, not knowing what fate had befallen them, the wanderers were lifted up and borne far away out of the darkness and the fire.
The Lord of the Rings - Book V, Chapter 4 - "The Field of Cormallen"
In the Movie
Peter Jackson has said that this scene was inspired by a John Howe painting:
This was an image that was based or inspired by a painting that John Howe did. It was this moment, this exact moment, and I remember seeing the painting. It was while we we were in pre-production on the film. We hadn't shot anything yet. And that painting just gave me a sense of exactly what this moment should be.
The Return of the King Extended Edition Director's Commentary
However, the painting in question only shows one eagle, so this particular aspect seems to not be derived from there. It would therefore seem that Peter Jackson used three Eagles purely because that's what happened in the book. (Also of note, while in the book it is possible that each eagle carried a different person, in the movie Gwaihir can be seen carrying both Gandalf and Frodo.)
John Howe - The End of All Things