The question: in the Laws of Kings, the Rambam brings Bilam's prophecy as a source for the coming of Moshiach, and explains each verse separately — part about David, the first anointed king, and part about the final Moshiach. Why is this needed, when there is already the verse "and the L-rd your G-d will bring back your captivity"?
What the verse in Deuteronomy does not say: "G-d will bring back your captivity" teaches about the Redemption — but not that there will be an anointed king of the House of David who restores the kingdom of David to its former state. That is what Bilam's prophecy teaches.
Four comparisons between David and Moshiach, verse by verse:
- Their personal qualities in Torah and mitzvot.
- Leadership over Israel — "a star" and "a scepter".
- Rule over the nations.
- And the relation to Edom and Seir — "Edom shall be a possession, and Seir shall be a possession".
Cities of refuge: the Rambam also brings the mitzvah of adding three cities of refuge — which was never fulfilled. Hence the completion of the mitzvot belongs to the days of Moshiach.
No miracles needed: Moshiach does not need to perform signs and wonders — the Torah is eternal, and nothing is to be added to it or taken from it. His signs are the keeping of Torah and mitzvot, building the Temple and gathering the exiles.
In practice
Faith in Moshiach includes the faith that he will restore the kingdom of David and complete the keeping of Torah and mitzvot. Awaiting his coming every day, and studying the laws of Moshiach — bring the Redemption closer.