"...but a fool [kasil] of a man will swallow him up" — This is Yehoshua who was not a ben Torah.
And his fellow Jews would call him a kasil — a fool.
And because he was serving Moshe, he merited to inherit him. For [Yehoshua] would honor [Moshe Rabbeinu] and spread the sheet over the bench and sit beneath his feet.
Therefore, HaKadosh Baruch Hu said, "I will not withhold your reward—as is written: 'He who guards a fig tree shall eat its fruit'..."
Rashi notes the one who guards his master shall eat the fruits of his deeds—as Hashem caused to happen for Yehoshua.
It's mind-boggling to realize that such a historic tzaddik like Yehoshua bin Nun—the man who stopped the sun!—was initially stuck on such a low level that everyone around him considered him a fool.
Once again, we see that the person who actually had to build himself ended up greater than the people born with it all.
This repeats itself throughout Tanach.
We also see this with David Hamelech, who built himself up with everything against him in contrast to Shaul Hamelech, who seemed to have it all naturally.
But Shaul lost the kingdom while David Hamelech merited eternal royalty as the progenitor of Mashiach.
This theme reverberates throughout Tanach...
It's not what you have, but what you do with whatever you have.