A couple of points on the parsha.
The Chosom Sofer at the and of his responsa on
Yoreh Deah points out that the story of Balak and Bilam is unique in the Torah for no one new about it. No body in Klal Yisroel saw what they were doing; the entire
parsha was dictated by Hashem. We see from here a tremendous lesson in
emunah. Hashem is always protecting us, even when we don't realize. Even at a time when Klal Yisroel isn't praying or doing anything to shield against the attack Hashem is still watching over us. Based upon this we can understand the Gemorah in Berachos (12b) that says Chazal wanting to put the parsha of Bilam in
krias shemah. The Gemorah says why, because אמר רבי יוסי בר אבין משום דכתיב בה האי קרא כרע שכב כארי וכלביא מי יקימנו. Rashi says: כרע שכב - דדמי לבשכבך ובקומך שהקדוש ב"ה שומרנו בשכבנו ובקומנו לשכב שלוים ושקטים כארי וכלביא. However, it still needs to be explained what does the
parsha of Balak have to do with the theme of
shemah of accepting Hashem's oneness and kingship? Based upon this Chosom Sofer we understand that this
parsha is a living example of Hashem's
hashgacha over everything. That is what the
possuk means כרע שכב, even when we are sleeping and not aware of who is coming to attack us, Hashem is still looking after us.
The Ramban (24:1) says:
ולא הלך כפעם בפעם לקראת נחשים – כי בפעמים הראשונים היה מנחש ורוצה לקלל אותם בנחש, והיה השם בא אליו בדרך מקרה, לא בכונתו לנבואה ולא ממעלתו שהגיע אליה, ועתה כאשר נאמר לו: כי לא נחש ביעקב ולא קסם בישראל (במדבר כ״ג:כ״ג) להרע או להטיב להם, הניח הנחשים ולא הלך כפעם בפעם לקראתם. אבל שם אל המדבר פניו אשר ישראל שם, שיראה אותם ויכין להם נפשו, שיחול עליו הדבור מאת השם כאשר עשה עמו פעמים, וכן היה לו. על כן אמר: ותהי עליו רוח אלהים – כי עתה היתה עליו יד י״י כאשר היא לנביאים, כמו שאמר: ומי יתן כל עם י״י נביאים כי יתן י״י את רוחו עליהם (במדבר י״א:כ״ט), ואומר: רוח י״י אלהים עלי (ישעיהו ס״א:א׳). ועל כן קרא עצמו עתה: שומע אמרי אל (במדבר כ״ד:ד׳), כי נביא הוא. The Ramban holds that the first 'prophecies' of Bilam weren't real prophecies; Hashem merely took over his mouth. However, the third time Balak assented to the level of real prophesy. How could such a lowlife as Bilam receive prophesy? The answer lies in the words of the Ramban. Bilam took a look deep down in his soul, now that he was looking at Klal Yisroel the good in his soul was magnetically pulled toward the
kedusha in front of it and came out. By focusing on the this aspect of his soul (which had tremendous potential,) Bilam was able to receive prophesy. The lesson in that if a person focuses on true service of Hashem, even if his/her character hasn't been changed completely, the individual can already tap into the river of truth (based on Mictav M'eliyahu volume 4.)
Rashi 22:28 says: [זה שלש רגלים – רמזה לו אתה מבקש לעקור אומה החוגה שלש רגלים בשנה.] Everyone asks why is it specifically the merit of the three
regalim that brings Bilam down? The idea is that Bilam was one of the greatest intellectuals of the day, he knew all of the philosophy, the arts, all the wisdom and even the all of the ethical teachings and laws of the day. What was lacking was the legs. The legs are the lowest part of the body, the part farthest from the brain. (See similar theme
here.) The feet only act based upon what is ingrained into the core of the person. The wisdom of Bilam was limited to his brain, it didn't affect his feet, his actions didn't parallel his wisdom. It is the mitzvoh of the feet going up on the
regel that is the opposite of Bilam. It demonstrates that the body of a Jew itself becomes imbued with holiness. That was something that Bilam couldn't match up to and that is what worked against him.