Yehoshua was neither commanded to accompany Moshe Rabbeinu, nor did he have any function at the mountain. Nonetheless, as the loyal student and servant, he accompanied his Rebbe and waited for him at the foot of the mountain for forty days until he returned. The question is obvious: What did Yehoshua achieve by waiting at the bottom of the mountain? If he thought he would miss something, he could have set his “alarm clock” for forty days later (in the morning) and run up to the mountain and wait for Moshe. Why did he camp out at the mountain for forty days, despite knowing full well that Moshe would not descend until the appointed time? What was to be gained from waiting?
Perhaps Yehoshua wanted nothing to come between his holy Rebbe’s leaving and returning. The relationship that he had with Moshe was one of lo yamush mitoch ha’ohel; “he never left the tent.” Yehoshua’s essence never left Moshe’s tent. He was bound, body and soul, to his Rebbe. What took place when his Rebbe left him, when his Rebbe left the tent? How was Yehoshua to maintain his unimpaired relationship to Moshe? He did this by remaining with Moshe until the very last possible moment and then remaining at that same place, unmoving, not returning to the communal camp, so that his mind remained attached to his Rebbe without pause or interruption until Moshe returned. This is what is meant by not leaving the tent. His body, as well as his mind, was totally connected to the tent.