Why did Jesus keep himself and the disciples hungry and thirsty on some occasions? We see at Matthew 12:1 (NRSVCE) :

"At that time Jesus went through the grainfields on the sabbath; his disciples were hungry, and they began to pluck heads of grain and to eat."

We also see at Mark 11:12:

"On the following day, when they came from Bethany, he was hungry. "

Taking a cue from the above instances, one would surmise that Jesus kept himself and the disciples hungry and thirsty at least on a few occasions. My question therefore is: Did the Lord have a purpose of allowing himself and the disciples to be hungry and thirsty sometime during his ministry , say strengthening of their  will-power , or, were those occasions the result of sheer chance ? What do the teachings of Catholic Church tell us about those occasions ?
Matthew 12:1
St. Thomas Aquinas's commentary on Matthew 12:1 gives two reasons for their hunger:

The disciples were hungry, and they began to pluck the ears of grain. Here two things should be considered: first,

the need, because they were hungry. And why? Because they were poor; hence 1 Corinthians (4:4): &quot;Even to this hour we hunger and thirst...&quot;

The second reason

is that they had been impeded on account of the crowds; hence they hardly had time to eat, as it says in Mark (4:31). But how did they satisfy their hunger? And example of abstinence is given to us, for they did not look for dishes of food but grains, in keeping with 1 Timothy (6:8): &quot;If we have food and clothing, with these we are content.&quot;

Mystically by the plucking of the grains is understood the manifold understanding of Scripture or the conversion of sinners.

Mark 11:12
Commenting on Mark 11:12, St. John Chrysostom says in his Matt. Hom., 87 (as quoted in St. Thomas Aquinas's Golden Chain on Mark 11):

How is it that He was hungry in the morning, as Matthew says, if it were not that by an economy He permitted it to His flesh?
There follows, &quot;And seeing a fig tree afar off having leaves, He came, if haply He might find any thing theron.&quot; Now it is evident that this expresses a conjecture of the disciples, who thought that it was for this reason that Christ came to the fig tree, and that it was cursed, because He found no fruit upon it. For it goes on: &quot;And when He came to it, He found nothing but leaves; for the time of figs was not yet. And Jesus answered and said unto it, No man eat fruit of thee hereafter for ever.&quot; He therefore curses the fig tree for His disciples' sake, that they might have faith in Him. For He everywhere distributed blessings, and punished no one, yet at the same time, it was right to give them a proof of His chastising power, that they might learn that He could even cause the persecuting Jews to wither away; He was however unwilling to give this proof on men, wherefore He shewed them on a plant a sign of His power of punishing. This proves that He came to the fig tree principally for this reason [of showing His power], and not on account of His hunger, for who is so silly as to suppose that in the morning He felt so greatly the pains of hunger, or what prevented the Lord from eating before He left Bethany? Nor can it be said that the sight of the figs excited His appetite to hunger, for it was not the season of figs; and if He were hungry, why did He not seek food elsewhere, rather than from a fig-tree which could not yield fruit before its time? What punishment also did a fig tree deserve for not having fruit before its time? From all this then we may infer, that He wished to shew His power, that their minds might not be broken by His Passion.

St. Bede interprets Jesus's hunger as &quot;desiring the salvation of mankind&quot;:

Just in the same way as He speaks parables, so also His deeds are parables; therefore He comes hungry to seek fruit off the fig tree, and though He knew the time of figs was not yet, He condemns it to perpetual barrenness, that He might shew that the Jewish people could not be saved through the leaves, that is, the words of righteousness which it had, without fruit, that is, good works, but should be cut down and cast into the fire. Hungering therefore, that is, desiring the salvation of mankind, He saw the fig tree, which is, the Jewish people, having leaves, or, the words of the Law and the Prophets, and He sought upon it the fruit of good works, by teaching them, by rebuking them, by working miracles, and He found it not, and therefore condemned it. Do thou too, unless thou wouldest be condemned by Christ in the judgment, beware of being a barren tree, but rather offer to Christ the fruit of piety which He requires.