Another interpretation: When Israel crossed the Jordan, all the kings of Canaan came in and made war against Israel, as it is said (Joshua 11:1, 4), "And it came to pass when Jabin king of Hazor heard, that he sent to Jobab" and so forth, "and to the kings who were in the north, and they went out, they and all their camps with them"; (Joshua 9:2) "and they gathered together to fight with Joshua and with Israel with one accord." In that hour Joshua prayed, and they all fell silent as a stone.
The Kings of Canaan Massed and Joshua Prayed Them to Stone
Yalkut Shimoni on Torah 251:18
דָּבָר אַחֵר כֵּיוָן שֶׁעָבְרוּ יִשְׂרָאֵל הַיַּרְדֵּן נִכְנְסוּ כָּל מַלְכֵי כְּנַעַן וְעָשׂוּ מִלְחָמָה עִם יִשְׂרָאֵל, שֶׁנֶּאֱמַר (יהושע יא, א ד) "וַיְהִי כִּשְׁמֹעַ יָבִין מֶלֶךְ חָצוֹר וַיִּשְׁלַח אֶל יוֹבָב וְגוֹ' וְאֶל הַמְּלָכִים אֲשֶׁר מִצְּפוֹן וַיֵּצְאוּ הֵם וְכָל מַחֲנֵיהֶם עִמָּם" וְגוֹ' (שם ט, ב) "וַיִּתְקַבְּצוּ לְהִלָּחֵם עִם יְהוֹשֻׁעַ וְעִם יִשְׂרָאֵל פֶּה אֶחָד". בְּאוֹתָהּ שָׁעָה הִתְפַּלֵּל יְהוֹשֻׁעַ וְדָמְמוּ כֻּלָּם כָּאֶבֶן.