...it's mentioned that at some time in the past, Gwaihir (the "Lord of the
Eagles") had been wounded, shot with an arrow, and Gandalf found him and healed
him, saving his life. I suspect that this is the favor in question,
although one might suppose the help the eagles gave to Thorin and Company,
including Gandalf, might have constituted part of the repayment. But
perhaps this was repayment of a more personal kind, since you will note that
the instances referred to in LotR are all either specifically for Gandalf's
benefit, or done at his request. In the Hobbit, the Eagles' rescue was
their choice; they rescued the company from the goblins largely because they
hated goblins, not because they were doing a favor for Gandalf (even though he
was one of those saved). And their part in the Battle of the Five Armies
was also doubtless done for their own benefit, driven by their hatred for the
goblins, not (as far as we know) because Gandalf asked for their aid.
Actually, if this question has come up, it hasn't been recently.
:)
Watson's Website