דָּרַךְ כּוֹכָב מִיַּעֲקֹב וְקָם שֵׁבֶט מִיִּשְׂרָאֵל
a star has gone forth from Jacob, and a staff will arise from Israel.
It is interesting that when Maimonides (Hilchos Melachim \ 11:1) mentions the principle of faith in the King Messiah he quotes this verse as the proof- text. Why didn’t Maimonides cite the verse When you are distressed, and all these things happen upon you in the end of days, then you will return to the Lord your God (Deut. 4:30)?
The belief in bi’as hamashiach is two-fold. First we believe in malchus Shamayim, namely, that the Ribbono shel Olam will be, king over the entire world. When during the Yamim Noraim we recite “And you, Hashem, will reign alone over all Your works,” the text does not refer to a human being, not even to the melech hamashiach. It refers to God Himself. No one but God, only God, will be the king. However, we also believe in a melech hamashiach as a person who will come and redeem the world and the Jewish people. We believe that a melech hamashiach will fulfill many of the promises made by Ha-Kadosh Baruch Hu. He will be not an angel, but a human being. Maimonides has a list of the features, both physical and psychological, that will qualify him as the melech hamashiach. This is also part of the belief.
The Gemara (Sanhedrin 98b-99a) says in the name of Hillel, “There will be no Messiah for the Jewish people.” Mashiach will not come. Rashi (99a) explains that according to Hillel, Hakadosh Baruch Hu Himself will be the redeemer of the Jewish people. It will not be a human being whom Hakadosh Baruch Hu will send as a messenger, but Hakadosh Baruch Hu will do it Himself.
Rabbi Yosef strongly disagrees with Hillel (Sanhedrin 99a), “May his Master [i.e., Hakadosh Barukh Hu] forgive Hillel”? Belief in melech hamashiach requires us to also believe that at a certain time, Hakadosh Baruch Hu will send a messenger who will rule the world. According to Rabbi Yosef, to assert that no human being will be a messenger is a heretical denial of melekh hamashiach. The belief that Hakadosh Baruch Hu will be the redeemer is not enough. We need to add that, yes, He will be the redeemer, but before He completely redeems the world, someone else, a messenger of His, will come. Since Rabbi Hillel said that Hakadosh Baruch Hu Himself will do it, Rabbi Yosef declared that his statement was unacceptable.
This explains why Maimonides cited verses from Parashas Balak as the source for his understanding of the belief in the melech hamashiach. (The Lord is Righteous pp. 81-84)