How did the wise men know of the coming of the messianic king?
In Matthew 2:1-2 it says Now when Jesus was born in Bethlehem of Judaea in the days of Herod the king, behold, Wise-men from the east came to Jerusalem, saying, 2 Where is he that is born King of the Jews? for we saw his star in the east, and are come to worship him.
These Wise-men or magi from the east were Babylonian astrologers who specialized in the study of the stars. The Bible never refers to them as kings neither do we know how many there were, but we know there had to be at least 2, because men is plural and there had to be enough of them to stir up Jerusalem which we see in Matthew 2 verse 3. In the Bible, the East is always the area of Mesopotamia, so there are at least two astrologers from Babylon.
Now in ancient times astrology and astronomy were not separate disciplines, if anyone would recognise a new light in the heavens it would be these men, because that was their profession. Now God uses these ancient astrologers/astronomers to identify a new light in the heavens. And they see this light, but how would they connect this with the birth of the Jewish king?
We have two sources for that. The first source dealing with the prophecy of the star would be Balaam found in Numbers 24:17 – I see him, but not now; I behold him, but not nigh: There shall come forth a star out of Jacob, And a scepter shall rise out of Israel, And shall smite through the corners of Moab, And break down all the sons of tumult. In this prophecy he says a star shall come out of Jacob and a scepter shall rise out of Israel. By profession Balaam was an astrologer, a seer, who came from the region of Babylon, we find that in Deuteronomy 23:4. Balaam connected the coming of the messianic person with kingship and with a star. What that means is that the coming of the king of the Jews would be signaled by a star in the heavens.
The second source dealing with the timing would be the book of Daniel which provided them with the timetable of Messiahs first coming found in Daniel 9:24-27. This is the only place in the entire Old Testament that dates the Messiah’s coming which is the famous Seventy Sevens (weeks) of Daniel, found in Daniel 9:24–27.
When Daniel interpreted Nebuchadnezzars dream in Daniel 2, not only did he save the lives of all the Babylonian wise men, but he also became the head of the Babylonian school of Astrology. However, Daniel did not receive revelation from the stars but from the creator of those stars, the God of Israel.
Through Daniels faith many of the Babylonian astrologers turned away from the worship of the stars and began worshipping the God of Israel. So, a line of Babylonian wise men from generation-to-generation worshipped Jehovah the true God. And having the book written by their former head they looked forward to the coming Messiah, the King of the Jews. With Balaam himself being part of the Babylonian School of Astrology, he would have passed down the information to his colleagues about the revelation of the star in relation to the coming Jewish King. Then centuries later Daniel would have expounded to the Babylonian wise men as to when the star of Jacob would appear. Balaam connected the star with the kingship of Messiah while Daniel provided the Messianic timetable.
Now while these wise men in Matthew’s gospel had the book of Daniel, they did not have the book of Micah which prophesied the location of the Messiah’s birth to be in Bethlehem. We find that in Micah 5:2. For these wise men, the logical place for the king of the Jews to be born would have been Jerusalem, the Jewish capital. That is why they went to Jerusalem and to Herod first.
For further information you can refer to Dr Arnold Fruchtenbaum's MBS 020 'How did the Wise Men Know or is Astrology Valid?'