Moshe’s "career" as Bnei Yisrael’s leader began when Hashem instructed him at the burning bush to go to Egypt to tell Paroh to set them free. This episode is introduced with the simple description of Moshe as a shepherd leading his flock in the desert (Shemot 3:1). However, Chazal saw this role as the precursor to his leadership role. The analogy between leading a flock of sheep and leading a flock of humans is well-known. However, we find the analogy in relation to Moshe’s other major role, as the one who received Torah from Hashem and taught it to the nation.
Following is a metaphoric verse from Kohelet (12:11), as translated in the Art Scroll edition: "The words of the wise are like goads, and the nails well driven are the sayings of the masters of collections, coming from one Shepherd." Chazal understand this pasuk in relation to Torah and its study. The end of the pasuk responds to the issue of dealing with disputes among rabbis when one would hope for unanimity. The pasuk assures us that, in the final analysis, all of the opinions stem from the giving of the Torah by one shepherd. "All are ‘coming from one shepherd’- one G-d gave them, one leader said them in the name of the Master of all creations" (Chagiga 3b). Some commentators understand that the shepherd is Hashem, our ultimate leader, who gave the Torah. However, the Midrash Tanchuma (Beha’alotcha 16) relates it to Moshe, bringing the pasuk from our parasha as evidence that Moshe is a known shepherd.
What made Kohelet feel that Moshe’s one-time occupation as a shepherd epitomized his appropriateness to receive the Torah on Bnei Yisrael’s behalf? The Kli Yakar on our pasuk explained that Moshe would take his flock to quiet places where he philosophized and contemplated the Creator. This is an experience that is conducive for emerging prophets. As we recall, the Rambam considers the supreme level of Moshe’s prophecy, which made him appropriate to receive the Torah, as a basic tenet of faith.
However, there are likely other connections between the shepherd and the lawgiver. A shepherd does not produce anything, as a craftsman or a farmer does. Rather, he protects and sustains the flock by enabling them to graze themselves. So too, Moshe the teacher was not supposed to create new ideas but to relay that which Hashem had taught in the purest possible form. That is not a small task. A teacher needs to not only know how to teach the material but he is also responsible to ensure that the recipients in check. He is like a shepherd, who can easily become unfit to testify (see Bava Metzia 5b). If a shepherd allows his sheep to graze in unauthorized fields, he is considered a thief because of their actions.
The Maharsha (on Chagiga 3b) explains that the Kohelet’s shepherd is referring both to Moshe and to Hashem. This indicates that he who learns Hashem’s Torah and teaches it to others is a partner with Hashem in leading and sustaining his and His flock.