"And Moses caused Israel to journey" (Exodus 15:22). This is what Scripture says: "And He led forth His people like a flock" (Psalms 78:52). Just as the flock scatters in flight and the shepherd gathers them in, so were Israel in the wilderness, quarreling and weeping and complaining, as it is said, "How often did they rebel against Him in the wilderness" (Psalms 78:40). Yet, as it were, the Holy One, blessed be He, did not withdraw from them, but led them like a flock, as it is said, "And Moses caused Israel to journey." Another interpretation: Just as the flock breaks the trees and yet its owner is not strict with it, so it says, "And you, My flock, the flock of My pasture, are men" (Ezekiel 34:31), a flock with respect to punishments and men with respect to the granting of reward. Another interpretation: Why "like a flock"? Just as the shepherd guards his flock by day from the heat and by night from the wolves, so was the Holy One, blessed be He, as it is said, "The pillar of cloud departed not" (and so on), and it says, "And there shall be a booth for a shadow in the daytime" (Isaiah 4:6), and it says, "You led Your people like a flock" (Psalms 77:21).
God Shepherds a Grumbling Israel Like a Flock
Yalkut Shimoni on Torah 254:3
וַיַּסַּע מֹשֶׁה אֶת יִשְׂרָאֵל, זֶה שֶׁאָמַר הַכָּתוּב (תהלים סח, נב) "וַיַּסַּע כַּצֹּאן עַמּוֹ", מַה הַצֹּאן מִתְרַדֶּפֶת וְהָרוֹעֶה מְכַנְּסָם, כָּךְ הָיוּ יִשְׂרָאֵל בַּמִּדְבָּר מִתְלַחֲמִין וּבוֹכִין וּמִתְרַעֲמִים, כְּמַה שֶׁנֶּאֱמַר (שם, מ) "כַּמָּה יַמְרוּהוּ בַמִּדְבָּר", כִּבְיָכוֹל לֹא נִסְתַּלֵּק מֵעֲלֵיהֶם הַקָּדוֹשׁ בָּרוּךְ הוּא, אֶלָּא נִהַגָם כַּצֹּאן, שֶׁנֶּאֱמַר וַיַּסַּע מֹשֶׁה, דָּבָר אַחֵר מַה הַצֹּאן מְשַׁבֶּרֶת אֶת הָאִילָנוֹת וְאַף עַל פִּי כֵן אֵין בְּעָלֶיהָ מַקְפִּיד עָלֶיהָ, כָּךְ (יחזקאל לד, לא) ("ואתנה) [וְאַתֵּן] צֹאנִי" וְגוֹ', צֹאן לְעֳנָשִׁים וְאָדָם לְמַתַּן שָׂכָר. דָּבָר אַחֵר לָמָּה כַּצֹּאן, כְּשֵׁם שֶׁהָרוֹעֶה זָהִיר בְּצֹאנוֹ בַּיּוֹם מִפְּנֵי הַחַמָּה וּבַלַּיְלָה מִפְּנֵי הַזְּאֵבִים, כָּךְ הָיָה הַקָּדוֹשׁ בָּרוּךְ הוּא "לֹא יָמִישׁ עַמּוּד הֶעָנָן" וְגוֹ', וְאוֹמֵר (ישעיה ד, ו) "וְסֻכָּה תִּהְיֶה לְצֵל יוֹמָם", וְאוֹמֵר "נָחִיתָ כַצֹּאן עַמֶּךָ" וְגוֹ'.