"I will send My terror before you, and I will throw into confusion all the people" etc. (Exodus 23:27). This teaches that when Israel crossed the Jordan, no creature could stand before them, and whoever stood before them was immediately seized with diarrhea. It was taught: the hornet did not cross over with them. But is it not written, "And I will send the hornet"? Resh Lakish said: it stood on the bank of the Jordan and cast venom at them, blinding their eyes from above and unmanning them from below, as it is said, "And I destroyed the Amorite" (Amos 2:9). Rav Pappa said: there were two hornets, one in the days of Moses and one in the days of Joshua; the one of Moses did not cross over, the one of Joshua did. Three wars of panic the Holy One, blessed be He, promised to Israel upon their entry into the land, as it is said, "My terror" etc., "and the LORD your God will deliver them before you and throw them into great confusion" (Deuteronomy 7:23). And the Rabbis derive it from here: "And the LORD threw them into confusion before Israel" (Joshua 10:10); "And the LORD confused Sisera" (Judges 4:15); "And the LORD thundered with a great voice" etc. "and threw them into confusion" (1 Samuel 7:10), one for the past; "and lightnings in abundance, and discomfited them" (Psalms 18:15), and one in the days of Gog and Magog, "On that day there shall be a great panic from the LORD among them" etc. (Zechariah 14:13).
The Terror and the Hornet at the Jordan and Three Routs of Panic
Yalkut Shimoni on Torah 360:3
(שמות כג כז-כח) אֶת אֵימָתִי אֲשַׁלַּח לְפָנֶיךָ וְהַמֹּתִי אֶת כָּל הָעָם וְגוֹ'. מְלַמֵּד, כְּשֶׁעָבְרוּ יִשְׂרָאֵל אֶת הַיַּרְדֵּן אֵין כָּל בְּרִיָּה יְכוֹלָה לַעֲמֹד בִּפְנֵיהֶם, וְכָל הָעוֹמֵד בִּפְנֵיהֶם מִיָּד נִתְרָז. תָּנָא. צִרְעָה לֹא עָבְרָה עִמָּהֶם. וְהָכְתִיב וְשָׁלַחְתִּי אֶת הַצִּרְעָה. אֲמַר רֵישׁ לָקִישׁ. עַל שְׂפַת הַיַּרְדֵּן עָמְדָה, וְזָרְקָה בָּהֶן מָרָה, וְסִימְתָה עֵינֵיהֶם מִלְּמַעְלָה וְסֵרַסְתָּם מִלְּמַטָּה, שֶׁנֶּאֱמַר (עמוס ב, ט) "וְאָנֹכִי הִשְׁמַדְתִּי אֶת הָאֱמֹרִי". רַב פַּפָּא אֲמַר. שְׁתֵּי צְרָעוֹת הֲווּ, חָדָא דְּמֹשֶׁה וְחָדָא דִּיְהוֹשֻׁעַ, דְּמֹשֶׁה לֹא עָבְרָה, דִּיְהוֹשֻׁעַ עָבְרָה. שָׁלֹשׁ מִלְחָמוֹת שֶׁל מְהוּמָה הִבְטִיחַ הַקָּדוֹשׁ בָּרוּךְ הוּא לְיִשְׂרָאֵל בִּכְנִיסָתָן לָאָרֶץ, שֶׁנֶּאֱמַר אֶת אֵימָתִי וְגוֹ', "וּנְתָנָם ה' אֱלֹהֶיךָ לְפָנֶיךָ, וְהָמָם מְהוּמָה גְדֹלָה". וְרַבָּנָן יָלְפֵי מֵהָכָא, (יהושע י, י) "וַיְהֻמֵּם ה' לִפְנֵי יִשְׂרָאֵל", "וַיָּהָם ה' אֶת סִיסְרָא", (שמואל א ז, י) "וַיַּרְעֵם ה' בְּקוֹל גָּדוֹל" וְגוֹ' "וַיְהֻמֵּם", אֶחָד לְשֶׁעָבַר (תהלים יח, טו) "וּבְרָקִים רָב וַיְהֻמֵּם", וְאַחַת בִּימֵי גּוֹג וּמָגוֹג "בַּיּוֹם הַהוּא תִּהְיֶה מְהוּמַת ה' רַבָּה" וְגוֹ'.