(2) As Balaam looked up and saw Israel encamped tribe by tribe, the spirit of God came upon him. (3) Taking up his theme, he said:
Word of Balaam son of Beor,
Word of the man whose eye is true,
(4) Word of one who hears God’s speech,
Who beholds visions from the Almighty,
Prostrate, but with eyes unveiled:
(5) How fair are your tents, O Jacob,
Your dwellings, O Israel!
כמו שיורה שם יעקב שישאר בעקב ובאחרית הכל ולא יסוף וכמו שיורה שם ישראל לשרר עם אלהים ועם אנשים:
The very name יעקב also contains such a dual meaning. On the one hand it appears to have a negative connotation, but it also symbolises עקב a heel, something at the tail end of matters, meaning after everything else has already disappeared the עקב still remains, endures. The name “Israel” that was added to Jacob’s name was justified by this thought, that its bearer had come out of a confrontation with celestial forces and had survived, had endured. If Israel could contend with celestial forces successfully, it would certainly be able to do so with terrestrial forces, i.e. עם אנשים, (Genesis 32:29).
מה טובו אוהליך יעקב, “How fair are your tents, O Jacob.” The reason that Balaam complimented the Jewish people in these terms is that Jacob had been described by the Torah as: איש תם יושב אהלים, “a quiet man, a dweller in tents.” (Genesis 25:27)
With these phrases, the Rabbis transform Balaam's God of war into a God of chesed (loving-kindness), and each Jew who utters these words becomes the prayer. ... Balaam's utterance is also incomplete, which is why our liturgy expands it—and also shifts the focus to the relationship of the individual with God.
Rabbi Sue Levi Elwell, "Contemporary Reflection" in The Torah: A Women's Commentary, eds. Rabbi Dr. Tamara Cohn Eskenazi and Rabbi Dr. Andrea L. Weiss (2008), pg. 956-957
Henry Wadsworth Longfellow, in Day by Day - Reflections on the Themes of the Torah from Literature, Philosophy, and Religious Thought, ed. Rabbi Chaim Stern (1998), pg. 266-267
Chasidic prayer, edited by Rabbi Chaim Stern, in Day by Day - Reflections on the Themes of the Torah from Literature, Philosophy, and Religious Thought, ed. Rabbi Chaim Stern (1998), pg. 268