And the time is specified, namely forty days, so that thus the truth might correspond to the figure: so Moses, Exodus chapter twenty-four; so Elijah, Third Kings chapter nineteen, so that thus Christ's fast might have testimony from both the Law and the Prophets. And lest you believe that Christ withdrew there for rest, it is added: And He was tempted by the devil, not interiorly, but only exteriorly. For as Gregory says: "The delight of sin did not bite His mind"; Hebrews chapter four: "We do not have a High Priest who cannot have compassion on our infirmities, tempted in all things according... to likeness, without sin."
Third, he introduces a wondrous abstinence, when he adds: And he ate nothing in those days, namely the forty days. From this the devil suspected him to be God, because he was fasting beyond human power, which commonly does not extend beyond three days; hence in Matthew 15 it is said concerning the crowds who had been fasting for three days: "I am unwilling to send them away fasting, lest they faint on the way." And note here that the Savior fasted before the temptation and ate after the resurrection for our instruction. Hence Augustine: "Christ fasted before the death of the flesh, as if crying out: Abstain from carnal desires, while you are in the struggle. He ate after the resurrection, as if to say: while you have a mortal body, feed yourselves now on the hope of immortality, because while we travel the way of the Lord, we ought both to fast from the vanity of the world and to be refreshed by the promise of the future," so that we may always say: "I shall be satisfied when your glory appears."
Finally, he adds an apparent need, when he subjoins: And when they were completed, he was hungry. For he did not wish to abstain any longer, lest the devil be able to perceive it. Hence Ambrose: "He hungers, lest the sublime God be recognized; for the hunger of the Lord is a pious ruse, lest the devil beware of tempting him." And note that he hungered in the temptation, as is said here, and thirsted in the passion, as is said in John 19, to show that he had true humanity, and to invite to poverty and the painfulness of penance; hence the Apostle in 2 Corinthians 11: "In hunger and thirst, in cold and nakedness, in many fastings." Moreover, he hungered and thirsted not for himself, but for us, for whom he merited the spiritual refreshment of his body and blood, by which we are fed and given drink; John 6: "My flesh is truly food, and my blood is truly drink."
Source: Commentary on Luke, Chapter 4