Bereshit / Genesis 49:10 · Pshat
לֹא־יָסוּר שֵׁבֶט מִיהוּדָה וּמְחֹקֵק מִבֵּין רַגְלָיו עַד כִּי־יָבֹא שילה [שִׁילוֹ] וְלוֹ יִקְּהַת עַמִּים׃
The sceptre shall not depart from Yehudah, nor the lawgiver from between his feet, until Shiloh comes, and to him shall be the obedience of the peoples.
Pshat פְּשָׁט
Sceptre and lawgiver
Yaakov (Jacob) promises Yehudah (Judah) a rule that will not depart from him "until Shiloh comes". Who is Shiloh, and what does a lawgiver "from between his feet" mean?
Rashi: the "sceptre" is rule from David onward, the exilarchs in Babylonia. The "lawgiver" is the students, the princes of the Land of Israel. "Shiloh" is King Mashiach (the Messiah), to whom the kingship belongs, "shai lo", "a gift to him". "The obedience of the peoples" is their gathering around him. Haamek Davar: the "lawgiver" is the one who finds new things in Torah, and that is possible only with students. Students sat on the ground at their teacher's feet: hence "from between his feet".
How Rashi and Haamek Davar explain it
Rashi The sceptre shall not depart from Yehudah
From David onward. These are the exilarchs in Babylonia, who rule the people with a rod, for they are appointed by the government.
Nor the lawgiver from between his feet.
Students. These are the princes of the Land of Israel.
Until Shiloh comes.
King Mashiach, to whom the kingship belongs. So Onkelos translates. And the aggadic midrash: "Shiloh" is "shai lo" (שַׁי לוֹ, "a gift to him"), as it says: "they shall bring a gift to the Awesome One" (Tehillim / Psalms 76:12).
And to him shall be the obedience of the peoples (יִקְּהַת עַמִּים).
The gathering of peoples. For the letter yud (י) is a root letter, as in "your splendour" (יִפְעָתֶךָ, Yechezkel / Ezekiel 28:17), and sometimes it drops out. Several letters behave this way in the language, and they are called "falling root letters": for example, the nun (נ) of "striking" (נוֹגֵף) and of "biting" (נוֹשֵׁךְ), and the alef (א) of "my declaration in your ears" (Iyov / Job 13:17), of "the point of the sword" (Yechezkel / Ezekiel 21:20), of "a jug of oil" (Melachim II / 2 Kings 4:2). So too this "יִקְּהַת עַמִּים" is a gathering of peoples, as it says: "to him shall the nations seek" (Yeshayahu / Isaiah 11:10). And similar is: "the eye that mocks a father and scorns the wrinkles (לִיקְּהַת) of a mother" (Mishlei / Proverbs 30:17), the gathered wrinkles of the face from old age. And in the Talmud (Yevamot 106b): "they sit and gather gatherings in the markets of Nehardea". And he could have said "קְהִית עַמִּים".
Haamek Davar The sceptre shall not depart from Yehudah, nor the lawgiver from between his feet
It is known what the sages of blessed memory expounded in Sanhedrin (5a): the "sceptre" is the exilarch in Babylonia, who rules the people with a stick. And this is "sceptre" in its plain sense. And the "lawgiver" is the descendants of Hillel, who teach Torah in public. The explanation of this: the "lawgiver" (מְחוֹקֵק) is the one who brings new insights in Torah and carves (מְחַקֵּק) with his reasoning. And this is impossible except through students, as is said in Taanit (7a): "Rabbi Chanina said: much I have learned from my teachers and so on, and from my students more than from all". And they compared there further: as a small stick kindles a large one, so a student helps the teacher grasp the essence of the law. And "from between his feet" means: from between the feet of the lawgiver (and so Sforno explains in his own way). For in former times the custom was that the teacher sat on a bench and the students discussed before him on the ground, as is said in Bava Metzia (84b): when they sat and so on, Rabbi Elazar son of Rabbi Shimon and Rabbi sat before them on the ground, asking and answering. And in Sanhedrin (17b): "discussing before them on the ground". So the students sat between the teacher's feet. And this is the explanation: there shall not depart from Yehudah the lawgiver "from between his feet", that is, heads of yeshivot who study Torah with students sitting between their feet.
Takeaway
The exilarch (רֹאשׁ הַגּוֹלָה) was the head of Babylonian Jewry, from the house of David. The prince (נָשִׂיא) in the Land of Israel came from Hillel's descendants, also of the tribe of Yehudah. Rashi sees the blessing fulfilled in them even after the kingdom ceased.
Onkelos translates "until Shiloh comes" as "until Mashiach comes, to whom the kingship belongs".
"Shiloh" is written in the verse שִׁילֹה and read שִׁילוֹ. Hence the reading "shai lo" (שַׁי לוֹ), "a gift to him".