The prophecy of Balaam that appears in our Parashah is one of the few places in the Pentateuch (Chumash) where there are clear allusions to the complete Redemption at the hands of the Messiah. This paragraph is opened by Balaam with the proclamation: "Come, I will advise you concerning what this people will do to your people in the latter days." The text then continues with his prophecy about the future age. “THE MESSIAH AND THE
KING DAVID
At the end of his Code of Laws, the Yad HaChazakah, when Rambam discusses the laws of King Messiah, he writes:1: It is also said in the passage about Balaam, and there it is prophesied about two Messiahs: about the first Messiah, who is David, who saved Israel from the hand of its oppressors, and about the last Messiah who will arise from among his sons, and who will save Israel from the sons of Esau. And there it says: 'I see him, but not now'—this is David; 'I glimpse him, but not near'—this is King Messiah. 'A star from Jacob will set out on the path'—this is David; 'and a leader will arise from Israel'—this is King Messiah. 'And he will break the flanks of Moab'—this is David. 'And he will eliminate the sons of Sheth'—that is King Messiah.
This connection between David and the Messiah requires explanation. If we are talking about saviors of Israel, the one who seems closest to the Messiah is, at first glance, Moses, about whom it is written: "the first savior is the last savior." We must say that it is specifically in the relationship with King David that the essential characteristic of what endows the Messiah is expressed.
NO MIRACLES AND WONDERS
One of the points that Rambam3 emphasizes in the laws is "do not let it enter your mind that the Messiah King must perform miracles and wonders and innovate things that did not exist in the world." What will the Messiah actually do? Rambam4 explains: "The Messiah King will rise up and restore the monarchy to the House of David in its ancestral state, to its original power, and he will build the Holy Temple and gather the dispersed of Israel, and in his days all the laws will be in force again as they were in ancient times.".
The Rambam tells us here that the Messiah's primary function is to restore the monarchy of the House of David and achieve perfection in the observance of the Torah and the Mitzvot (which is unattainable today). Through the Messiah's re-establishment of the Kingdom of the House of David, the rebuilding of the Holy Temple, and the gathering of the dispersed of Israel, he will give the Jewish people the opportunity to once again live a full and complete Jewish life, as it was in the days of King David.
RESTORE PERFECTION
Since this is the essence of the Messiah's role, the way to identify the Messiah also falls within this framework. Rambam emphasizes that the Messiah does not need to perform signs and wonders. He provides another yardstick: "And if a king arises from the House of David, who studies Torah and attends to the mitzvot like his father David, according to both the Written and Oral Torah, and leads all Israel to walk in it and strengthens its breaches, and fights the wars of Hashem, etc.; this Jew can be presumed to be the Messiah (bejezkat Mashiach). And when he successfully completes this mission and conquers all the nations around him, and rebuilds the Holy Temple in its place and gathers the dispersed of Israel—that is the certain Messiah.".
In light of the foregoing, the connection between King Messiah and King David becomes clear. David's kingdom represents the life of Torah and Mitzvot in its entirety and completeness, a level of wholeness that does not exist today, as long as we remain in exile. The role of King Messiah (at least in the initial period following his arrival) is to deliver us from this situation and restore the missing perfection to the life of Torah and Mitzvot. He will rebuild the Holy Temple and enable all the people of Israel to live a full Jewish life. This is what Balaam alluded to in his prophecy, and this is what we eagerly await and pray to Hashem for every day.
(Likutei Sichot Volume 18, page 271)
NOTES: 1.Hilchot Melachim chap. 11, Halacha 1 2.Zohar Part I page 323,a Shaar HaPoskim Parshat Vayechi 3.Rambam there Halacha 3 4.There, beginning of Halacha 1 5.There Halacha 4 6.According to the uncensored text.