The passage states that God did not become angry with the Jewish people during all the days of Balaam the wicked man, and if He had been angry during those days, not a single enemy of Israel would have survived.
אָמַר רַבִּי יוֹחָנָן: מִבִּרְכָתוֹ שֶׁל אוֹתוֹ רָשָׁע אַתָּה לָמֵד מָה הָיָה בְּלִבּוֹ. בִּיקֵּשׁ לוֹמַר שֶׁלֹּא יְהוּ לָהֶם בָּתֵּי כְנֵסִיּוֹת וּבָתֵּי מִדְרָשׁוֹת – ״מַה טֹּבוּ אֹהָלֶיךָ יַעֲקֹב״. לֹא תִּשְׁרֶה שְׁכִינָה עֲלֵיהֶם – ״וּמִשְׁכְּנֹתֶיךָ יִשְׂרָאֵל״. לֹא תְּהֵא מַלְכוּתָן נִמְשֶׁכֶת – ״כִּנְחָלִים נִטָּיוּ״. לֹא יְהֵא לָהֶם זֵיתִים וּכְרָמִים – ״כְּגַנֹּת עֲלֵי נָהָר״. לֹא יְהֵא רֵיחָן נוֹדֵף – ״כַּאֲהָלִים נָטַע ה׳״. לֹא יִהְיוּ לָהֶם מְלָכִים בַּעֲלֵי קוֹמָה – ״כַּאֲרָזִים עֲלֵי מַיִם״. לֹא יִהְיֶה לָהֶם מֶלֶךְ בֶּן מֶלֶךְ – ״יִזַּל מַיִם מִדָּלְיָו״. לֹא תְּהֵא מַלְכוּתָן שׁוֹלֶטֶת בָּאוּמּוֹת – ״וְזַרְעוֹ בְּמַיִם רַבִּים״. לֹא תְּהֵא עַזָּה מַלְכוּתָן – ״וְיָרֹם מֵאֲגַג מַלְכּוֹ״. לֹא תְּהֵא אֵימַת מַלְכוּתָן – ״וְתִנַּשֵּׂא מַלְכֻתוֹ״. אָמַר רַבִּי אַבָּא בַּר כָּהֲנָא: כּוּלָּם חָזְרוּ לִקְלָלָה, חוּץ מִבָּתֵּי כְנֵסִיּוֹת וּמִבָּתֵּי מִדְרָשׁוֹת, שֶׁנֶּאֱמַר: ״וַיַּהֲפֹךְ ה׳ אֱלֹהֶיךָ לְּךָ אֶת הַקְּלָלָה לִבְרָכָה כִּי אֲהֵבְךָ ה׳ אֱלֹהֶיךָ״. קְלָלָה, וְלֹא קְלָלוֹת.
Rabbi Yoḥanan says: From the blessing of that wicked person, Balaam, you can ascertain what was in his heart. God transformed the curses that he planned into blessings. He sought to say that they should not have synagogues and study halls, and he said instead: “How goodly are your tents, Jacob” (Numbers 24:5), a blessing on their synagogues. He sought to say that the Divine Presence [shekhina] will not rest upon them, and he said instead: “And your dwellings [mishkenot] Israel.” He sought to say that the kingdom of Israel would not continue, and he said instead that it would continue: “Like the winding brooks” (Numbers 24:6), which flow continuously. He sought to say that they would have no olive trees and vineyards, and he said instead: “Like gardens by the river’s side” (Numbers 24:6). He sought to say that their fragrance would not diffuse from their fulfillment of mitzvot, and he said instead: “Like aloes that the Lord has planted” (Numbers 24:6). He sought to say that they would not have kings of stature, and he said instead: “Like cedar trees beside the waters” (Numbers 24:6). He sought to say that they will not have a king the son of a king, and he said instead: “Water shall flow from his branches” (Numbers 24:7). He sought to say that their kingdom would not rule over the nations, and he said instead: “And his seed shall be in many waters” (Numbers 24:7). He sought to say that their kingdom would not be fierce, and he said instead: “And his king shall be higher than Agag.” He sought to say that there will be no fear of their kingdom, and he said instead: “And his kingdom shall be exalted” (Numbers 24:7). Rabbi Abba bar Kahana says: All of the blessings ultimately reverted to be fulfilled as the curse that he originally intended, as all of those circumstances befell the Jewish people, except for the destruction of synagogues and study halls, as it is stated: “And the Lord your God transformed the curse into a blessing for you, because the Lord your God loved you” (Deuteronomy 23:6). A curse in the singular, not curses in the plural, was transformed permanently.