Another interpretation: He compressed them between the two poles of the Ark. Joshua said to them: From the fact that the two poles of the Ark held all of you, you know "that the living God is in your midst" (Joshua 3:10). So too with Jerusalem, as we have learned (Avot 5:7): They stood crowded together yet bowed with ample space, four cubits for each and every one, and a cubit on every side, so that none of them should hear the prayer of his fellow. So too in the time to come, as it is said: "They shall call Jerusalem the throne of the LORD, and all the nations shall be gathered to it" (Jeremiah 3:17). But can it hold them? Rather, the Holy One, blessed be He, says to her: Lengthen yourself, widen yourself, receive your multitudes, as it is said (Isaiah 54:2-3): "Enlarge the place of your tent, for you shall break forth to the right and to the left," and so on.
The Ark Poles and the Jerusalem That Makes Room for All
Yalkut Shimoni on Torah 7:5
דָּבָר אַחֵר, צִמְצְמָן בֵּין שְׁנֵי בַּדֵּי אָרוֹן אָמַר לָהֶם יְהוֹשֻׁעַ, מִמָּה שֶׁהֱחֶזִיקוּ שְׁנֵי בַּדֵּי אָרוֹן אֶתְכֶם אַתֶּם יוֹדְעִים "כִּי אֵל חַי בְּקִרְבְּכֶם" אַף יְרוּשָׁלָיִם כֵּן דְּתָנִינָן (אבות פ"ה מ"ז) עוֹמְדִים צְפוּפִים וּמִשְׁתַּחֲוִים רְוָחִים אַרְבַּע אַמוֹת לְכָל אֶחָד וְאֶחָד, וְאַמָּה מִכָּל צַד, כְּדֵי שֶׁלֹּא יְהֵא אֶחָד מֵהֶן שׁוֹמֵעַ תְּפִלַּת חֲבֵרוֹ. אַף לֶעָתִיד לָבוֹא כֵּן, שֶׁנֶּאֱמַר "יִקְרָאוּ לִירוּשָׁלַיִם כִּסֵּא ה' וְנִקְווּ אֵלֶיהָ כָל הַגּוֹיִם", וְכִי מַחְזֶקֶת הִיא אֶלָּא הַקָּדוֹשׁ בָּרוּךְ הוּא אוֹמֵר לָהּ, הַאֲרִיכִי הַרְחִיבִי קַבְּלִי אוּכְלוּסַיִךְ, שֶׁנֶּאֱמַר (ישעיה נד, ב ג) הַרְחִיבִי מְקוֹם אָהֳלֵךְ כִּי יָמִין וּשְמֹאול תִּפְרֹצִי וְגוֹ'.