"And Moses said to Joshua." And why did he say it to Joshua? Because he came from the tribe of Joseph. It is written, "And the house of Jacob shall be a fire, and the house of Joseph a flame, and the house of Esau for stubble" (Obadiah 1:18) - let a flame go out from the house of Joseph and consume the stubble of the house of Esau; this is Joshua, who slew Amalek. Rabbi Pinchas in the name of Rabbi Shmuel bar Nachman: it is a tradition of aggadah that Esau will fall by the hand of the sons of Rachel, as it is written, "Surely the least of the flock shall drag them away" (Jeremiah 49:20). And why does it call them so? Because they are the smallest of the tribes. And it is written, "And it came to pass, when Rachel had borne Joseph" (Genesis 30:25), and it is written, "And out of Jacob shall one have dominion, and shall destroy the remnant of the city" (Numbers 24:19). Of this one [Joseph] "small" is written - "Behold, I have made you small among the nations" [said of Esau, Obadiah 1:2]; and of that one [Esau] "youth" is written, "and he was a youth with the sons of Bilhah" (Genesis 37:2). This one grew up between two righteous ones and did not learn from their deeds; and that one grew up between two righteous ones and did not learn from their deeds. This one [Joseph] was mindful of his Maker's honor, and that one despised his Maker's honor. Of this one is written, "and he did not fear God" [Esau], and of that one is written, "I fear God" (Genesis 42:18). Let this one come and fall by the hand of that one. "Behold, I will stand." From here, that the righteous rise early for the needs of the community. "I will stand" - in prayer, as it says, "and he stood with him there" (Exodus 34:5). "On the top" - I will recall the merit of the fathers, as it is said, "For from the top of the rocks I see him" (Numbers 23:9). "The hill" - I will recall the merit of the mothers, as it is said, "and from the hills I behold him" (Numbers 23:9). "And the rod of God in my hand" - that has seventy names. Joshua said: How many great ones are here in this generation - Aaron and Hur and seventy elders - yet Moses commanded none but me; not for nothing did he command me, but because he saw that Amalek falls by my hand. Immediately Joshua did as Moses said to him, to fight Amalek. "And Moses, Aaron, and Hur went up to the top of the hill" - from here, that three are needed to go down before the ark: the prayer-leader and two who assist.
Joshua of Joseph's Line Is Chosen to Bring Down Esau
Yalkut Shimoni on Torah 264:2
וַיֹּאמֶר מֹשֶׁה אֶל יְהוֹשֻׁעַ. וְלָמָּה אָמַר לִיהוֹשֻׁעַ, מִפְּנֵי שֶׁבָּא מִשִּׁבְטוֹ שֶׁל יוֹסֵף. כְּתִיב (עובדיה א, יח) "וְהָיָה בֵית יַעֲקֹב אֵשׁ וּבֵית יוֹסֵף לֶהָבָה וּבֵית עֵשָׂו לְקַשׁ", תֵּצֵא לֶהָבָה מִבֵּית יוֹסֵף וְתֹאכַל קַשׁ שֶׁל בֵּית עֵשָׂו, זֶה יְהוֹשֻׁעַ שֶׁהָרַג עֲמָלֵק. רַבִּי פִּנְחָס בְּשֵׁם רַבִּי שְׁמוּאֵל בַּר נַחְמָן, מָסוֹרֶת אַגָּדָה הִיא, בְּיַד בָּנֶיהָ שֶׁל רָחֵל עֵשָׂו נוֹפֵל, דִּכְתִיב (ירמיה מט, כ) "אִם לֹא יִסְחָבוּם צְעִירֵי הַצֹּאן", וְלָמָּה קוֹרְאָם כַּךְ, שֶׁהֵן קְטַנִּים שֶׁל שְׁבָטִים. וּכְתִיב (בראשית ל, כה) "וַיְהִי כַּאֲשֶׁר יָלְדָה רָחֵל אֶת יוֹסֵף", וּכְתִיב (במדבר כד, יט) "וְיֵרְדְּ מִיַּעֲקֹב וְהֶאֱבִיד שָׂרִיד מֵעִיר". זֶה כְּתִיב בּוֹ קָטָן, "הִנֵּה קָטָן נְתַתִּיךָ בַּגּוֹיִם", וְזֶה כְּתִיב בּוֹ נַעַר, (בראשית לז, ב) "וְהוּא נַעַר אֶת בְּנֵי בִלְהָה". זֶה גָּדַל בֵּין שְׁנֵי צַדִּיקִים וְלֹא לָמַד מִמַּעֲשֵׂיהֶן, וְזֶה גָּדַל בֵּין שְׁנֵי רְשָׁעִים וְלֹא לָמַד מִמַּעֲשֵׂיהֶן. זֶה חָס עַל כְּבוֹד קוֹנוֹ, וְזֶה בִּזָּה עַל כְּבוֹד קוֹנוֹ. זֶה כְּתִיב בּוֹ "וְלֹא יָרֵא אֱלֹהִים" וְזֶה כְּתִיב בּוֹ (בראשית מב, יח) "אֶת הָאֱלֹהִים אֲנִי יָרֵא". יָבֹא זֶה וְיִפֹּל בְּיַד זֶה. הִנֵּה אָנֹכִי נִצָּב. מִכַּאן שֶׁהַצַּדִּיקִים מַשְׁכִּימִין לְצָרְכֵי צִבּוּר. אָנֹכִי נִצָּב, בִּתְפִלָּה, [כְּמָה דְּהוּא אָמֵר] (שמות לד, ה) "וַיִּתְיַּצֵב עִמּוֹ שָׁם". עַל רֹאשׁ. אֲנִי מַזְכִּיר זְכוּת אָבוֹת, שֶׁנֶּאֱמַר "כִּי מֵרֹאשׁ צֻרִים אֶרְאֶנּוּ". הַגִּבְעָה. אֲנִי מַזְכִּיר זְכוּת אִמָּהוֹת שֶׁנֶּאֱמַר (שם) "וּמִגְּבָעוֹת אֲשׁוּרֶנוּ". וּמַטֵּה הָאֱלֹהִים בְּיָדִי. שֶׁיֵּשׁ בּוֹ שִׁבְעִים שֵׁמוֹת. אָמַר יְהוֹשֻׁעַ, כַּמָּה גְּדוֹלִים יֵשׁ כַּאן בַּדּוֹר הַזֶּה, אַהֲרֹן וְחוּר וְשִׁבְעִים זְקֵנִים, וְלֹא צִוָּה מֹשֶׁה אֶלָּא לִי, לֹא עַל חִנָּם צִוַּנִּי אֶלָּא שֶׁרָאָה שֶׁנּוֹפֵל בְּיָדִי מִיַּד וַיַּעַשׁ יְהוֹשֻׁעַ כַּאֲשֶׁר אָמַר לוֹ מֹשֶׁה לְהִלָּחֵם בַּעֲמָלֵק. וּמֹשֶׁה אַהֲרֹן וְחוּר עָלוּ רֹאשׁ הַגִּבְעָה. מִכַּאן לִשְׁלֹשָׁה שֶׁצְּרִיכִין לֵירֵד לִפְנֵי הַתֵּבָה, שְׁלִיחַ צִבּוּר וּשְׁנַיִם מְסַיְּעִין.