Their ancestor Balaam had foretold that a star would come forth from Jacob (Numbers 24:17), saying,
I see him but not now. I behold him, but not near.Numbers 24:17a
And since that time, the magi had watched the heavens.
In Balaam’s time, it was Balak the King of Moab who trembled at the sight of Israel and their God (Numbers 22:11) and God Himself who warned Balaam.
God said to Balaam, “Do not go with them; you shall not curse the people, for they are blessed.”Numbers 22:12
And now Balaam’s descendents faced another king, Herod, who secretly called the magi and determined from them the exact time the star appeared (Matthew 2:7).
And Herod sent them to Bethlehem and said, “Go and search carefully for the Child; and when you have found Him, report to me, so that I too may come and worship Him.”Matthew 2:8
But where Balaam had stumbled and faced his donkey’s and then the angel’s correction (see also Joshua 13:22), Balaam’s descendents would not falter. Instead, having followed the star and rejoiced exceedingly that their purpose had been fulfilled, the magi worshiped Jesus.
And having been warned by God in a dream not to return to Herod, the magi left for their own country by another way.Matthew 2:12
And so God fulfilled His promise to the magi, first uttered when the Spirit of God came upon Balaam. “Blessed is everyone who blesses you.”
God brings him out of Egypt,Numbers 24: 8-9
He is for him like the horns of the wild ox.
He will devour the nations who are his adversaries,
And will crush their bones in pieces,
And shatter them with his arrows.
He couches, he lies down as a lion,
And as a lion, who dares rouse him?
Blessed is everyone who blesses you,
And cursed is everyone who curses you.