Balaam's Star Out of Jacob and the Star of the Magi
Old Testament: Numbers 24:17
I shall see him, but not now: I shall behold him, but not near. A star shall rise out of Jacob, and a sceptre shall spring up from Israel: and shall strike the chiefs of Moab, and shall waste all the children of Seth.
New Testament: Matthew 2:2
Saying, Where is he that is born king of the Jews? For we have seen his star in the east, and are come to adore him.
The connection
Balaam, a pagan diviner hired to curse Israel, is seized by God and made to bless it instead: "I shall see him, but not now... a star shall rise out of Jacob" (Numbers 24:17), a Gentile prophet from the east given a glimpse of a king still centuries off. The Magi, wise men who come "from the east" themselves, are that oracle finally cashed in: they see a star rise and travel to adore the King it announces, asking openly, "Where is he that is born king of the Jews?" (Matthew 2:2). The scene turns on a contrast Matthew clearly intends. Herod and the chief priests possess the plainer prophecy, "thou, Bethlehem Ephrata... out of thee shall he come forth" (Micheas 5:2), sitting in their own scrolls a few miles from the very town named, and none of them travel those few miles to see. The Gentiles who have only a star to go on come from a great distance; the priests who have the text in hand do not leave the room.
Moral sense
Knowing the right answer is not the same as moving toward it; the soul that has studied the prophecy carefully but never leaves its own house has done no better than Herod's priests, while a stranger with only a star to follow can arrive first.
Anagogical sense
The Magi are the first of a procession that does not end with them: the ingathering of every nation to the light, foretold already in Isaias, "the Gentiles shall walk in thy light" (Isaias 60:3), completed only when every people, not merely a handful of stargazers, makes the same journey.
The Fathers
St Justin Martyr, Dialogue with Trypho, ch. 106, applying Balaam's oracle to the Magi: “A star shall arise from Jacob, and a leader from Israel... when a star rose in heaven at the time of His birth, as is recorded in the memoirs of His apostles, the Magi from Arabia, recognising the sign by this, came and worshipped Him.”
Warrant
Matthew 2:2 does not quote Numbers 24:17, but the identification is early and explicit outside the Gospel: Justin Martyr, writing in the middle of the second century, joins Balaam's star to the star the Magi followed in so many words.
Catechism of the Catholic Church, paragraph 528.