Unconditional Love Disarming Curses
בפסוק וישם ה' דבר בפי כו'
On the pasuk, "And Hashem placed a matter in Bilaam's mouth" (Bamidbar 23:5).
The Sfas Emes opens with the pasuk describing how Hashem put words into Bilaam's mouth, and he will examine the precise wording of "placed."
שימה הוא לשון סידור כמו ושמו כו' איש על עבודתו
The word "placed" (vayasem) denotes arranging and setting in order, as in "and they appointed each man over his service" (Bamidbar 4:19).
He notes that "vayasem" means to arrange and order, the same root used when each Levi was assigned and set over his particular avodah.
כי אותו הרשע הכין בפיו קללות
For that wicked one had prepared curses in his mouth.
Bilaam had readied a mouthful of curses against Bnei Yisrael.
והקב"ה הפך אותם לברכות כמ"ש ויהפוך
But the Holy One, Blessed is He, transformed them into blessings, as it is written, "And Hashem turned the curse into a blessing for you" (Devarim 23:6).
Hashem flipped those curses into blessings, as the Torah itself testifies that He turned the intended curse into a blessing.
ואותן אותיות עצמן נתחלפו ונסדרו להיות ברכות
And those very same letters were exchanged and rearranged so as to become blessings.
Remarkably, the identical letters Bilaam had prepared were simply reshuffled and reordered into words of blessing rather than being replaced.
ויתכן לומר כי כל זה הי' הכנת הרפואה קודם המכה מאת הקב"ה לפי שגלוי לפניו שעתידין לחטוא בשיטים וגם אותו רשע ראה עליהם זה החטא ורצה להזכיר עונם לקללם
And it may be said that all of this was the preparation of the cure before the wound on the part of the Holy One, Blessed is He, for it was revealed before Him that Bnei Yisrael were destined to sin at Shittim, and that wicked one too perceived this sin hovering over them and wished to recall their iniquity in order to curse them.
This was Hashem preparing the remedy before the blow: knowing Bnei Yisrael would later sin at Shittim, and that Bilaam sensed that very sin and wanted to invoke it to curse them, Hashem readied the cure in advance.
וכיון שנתהפך הקללה לברכה והטעם כי אהבך ה' אלקיך פי' כי אותו הרשע סבר כי אהבתו ית' את בנ"י מכח המצות ומעש"ט לכן הזכיר החטא להתפש
And since the curse was turned into a blessing, and the reason being "because Hashem your God loved you" (Devarim 23:6) — the explanation is that that wicked one supposed that the love of Hashem, Blessed is He, for Bnei Yisrael stemmed from the strength of their mitzvos and good deeds, and therefore he recalled their sin so that they might be caught in it.
Bilaam assumed Hashem's love for Bnei Yisrael was earned through their mitzvos and good deeds, so by recalling their coming sin he hoped to strip away that love and trap them.
אבל באמת אהבת הקב"ה לבנ"י אהבה שאינה תלוי' בדבר רק בעצם ואדרבה מטעם האהבה נתן לנו תורה ומצות
But in truth, the love of the Holy One, Blessed is He, for Bnei Yisrael is a love that is not dependent upon anything, but rather is essential, and on the contrary, it was on account of that love that He gave us the Torah and the mitzvos.
In truth, however, Hashem's love for Bnei Yisrael is unconditional and essential, not contingent on their deeds; indeed the Torah and mitzvos themselves flow out of that prior love.
וז"ש וירא כו' כי טוב בעיני ה' לברך וממילא אפילו שהוזכר העון שלעתיד נתגבר האהבה וממילא היחלש כח החטא ולכן גם כשחטאו אח"כ כבר נתגבר האהבה מקודם וז"ש מן השיטים כו' למען דעת צדקות ה' כנ"ל:
And this is the meaning of "And Bilaam saw that it was good in the eyes of Hashem to bless Yisrael" (Bamidbar 24:1) — and consequently, even though the future sin was recalled, the love was strengthened, and consequently the power of the sin was weakened; and therefore even when they later sinned, the love had already been strengthened beforehand, and this is the meaning of "from Shittim... in order that you may know the righteous acts of Hashem" (Michah 6:5), as explained above.
Because Hashem saw it was good to bless them, even raising the future sin only intensified that love and weakened the sin's power, so that when they did sin later the love had already been fortified in advance — which is why the navi links "from Shittim" to knowing the righteous acts of Hashem.
Summary: The Sfas Emes examines how Hashem "placed" words in Bilaam's mouth, explaining that the word denotes a rearranging and reordering: the very letters of the curses Bilaam had prepared were reshuffled into blessings. He explains that this was Hashem's preparing of the cure before the wound, for Bnei Yisrael were destined to sin at Shittim, and Bilaam, sensing this sin, wished to invoke it in order to curse them. Bilaam erred in thinking Hashem's love for Bnei Yisrael was earned through their mitzvos and good deeds, so that recalling their sin would forfeit that love; but in truth Hashem's love is essential and unconditional, and it is from that love that the Torah and mitzvos were given in the first place. Therefore the very recalling of the future sin only strengthened the love and weakened the power of the sin, so that the love was already fortified before Bnei Yisrael ever stumbled. This is why the navi ties "from Shittim" to knowing the righteous acts of Hashem.