Matthew 2:1 After Jesus was born in Bethlehem in Judea, during the time of King Herod, Magi a from the east came to Jerusalem 2and asked, “Where is the one who has been born king of the Jews? We saw his star when it rose and have come to worship him.”
3When King Herod heard this he was disturbed, and all Jerusalem with him. ...
9After they had heard the king, they went on their way, and the star they had seen when it rose went ahead of them until it stopped over the place where the child was. 10When they saw the star, they were overjoyed.
The scripture states that the Magi did NOT go to Herod the Great upon being led to Jerusalem by the star. They enquired in the city about the anticipated arrival of the King of the Jews. After making their enquiries, Herod was told of their presence in the city, and he enquired after them. In other words, he required their presence, to explain themselves. They dare not refuse this audience with king Herod. To decline would cause immediate suspicion that they were spies from a foreign land far away, and so the Magi pitched up at court - pronto. Yet that simple statement you quoted from Matthew 2:1-2 - they came to Jerusalem (not to Herod, at the first) - means that the star led them to Jerusalem - to a city, not a person.
They had set out on their huge journey already believing that the rare movement of stars in the night sky in the spring heralded the coming birth of a new king of the Jews. That is because the Magi held particular beliefs about particular movements of the constellations at particular times. Zoroastrian Magi viewed Jupiter as representing a new king; Saturn the old. The planets coming together would signify a change of ruler. This happening in Pisces would speak to them of Israel, as they associated Pisces with Israel. Once arrived in Jerusalem, their open declaration to Herod as to why they had come garnered them further direction – the religious leaders, who had also been summonsed by Herod, confirmed that prophecies showed Messiah would be born in Bethlehem. Herod sent them to Bethlehem (Matthew 2:7).
An article on this was in 1 September 2009 ‘Weekend’ magazine which was reviewing a BBC2 documentary on Christmas Eve that year. It gave that explanation of David Hughes, Professor of Astronomy at Sheffield University.
Then, the star appearing to stand still above a house in Bethlehem would absolutely assure them that their astronomical calculations and astrological expectations about a new king of Israel were sound. That is why the Bible records that "they were overjoyed" now being able to personally deliver their gifts for a king to this new child-King of the Jews. But the answer to your question is, "No, the star did not lead them to King Herod - it led them first to the city of Jerusalem, after which it led them to a particular location in Bethlehem."
The same question was asked on Quora. Below is my answer there. Let’s read the Gospel carefully and analyze it using common sense: After Jesus was born in Bethlehem in Judea, during the time of King Herod, Magi from the east came to Jerusalem 2 and asked, “Where is the one who has been born king of the Jews? We saw his star when it rose and have come to worship him.”…
7 Then Herod called the Magi secretly and found out from them the exact time the star had appeared. 8 He sent them to Bethlehem and said, “Go and search carefully for the child. As soon as you find him, report to me, so that I too may go and worship him.”
9 After they had heard the king, they went on their way, and the star they had seen when it rose went ahead of them until it stopped over the place where the child was. 10 When they saw the star, they were overjoyed. 11 On coming to the house, they saw the child with his mother Mary, and they bowed down and worshiped him. Bible Gateway passage: Matthew 2 - New International Version.
The Gospel says about only two separate sightings of an unusual celestial object that the Magi identified as a new star. Now, where were the Magi when they had those sightings? The Gospel does not say it. We must guess.
The first time the Magi saw his star when it rose and after that, they have come to worship him. Only one sighting means the Magi were in the vicinity of Jerusalem. According to the beliefs of their time, they concluded the rising of a new star over the capital means that a future great king of the Jews was just born there. The Magi hurried there to announce that fresh big news, to worship a newborn in the royal palace, and to get a valuable reward from the rich king for their good prediction and their job. You ask: Did the star lead the Magi to King Herod? Strictly speaking, no. The king could ignore them. But by curiosity “Herod called the Magi secretly and found out from them the exact time the star had appeared.”
From Jerusalem to Bethlehem the Magi followed the road winding through the hills, not the star. According to the Gospel, the second time the Magi saw the same star after “it stopped over the place where the child was. 10 When they saw the star, they were overjoyed.”
Hence according to the Gospel, the star never led the Magi. See https://www.quora.com/How-did-the-bogus-Star-of-Bethlehem-story-ever-get-started-It-is-so-full-of-inaccuracies-and-improbabilities-its-ridiculous/answer/Alexander-Reznikov-3 for more details.
From the account in Matthew chapter 2 the wise men from the East came first to Jerusalem. They knew about the prophecy of the birth of "the one who is born king of the Jews". But they did not know exactly where to locate the child. Herod interrogated the Jewish "priests and the experts in the law" who confirmed that the Christ would be born in Bethlehem.
Matthew 2:1-6: After Jesus was born in Bethlehem in Judea, in the time of King Herod, wise men from the East came to Jerusalem saying, “Where is the one who is born king of the Jews? For we saw his star when it rose and have come to worship him.” When King Herod heard this he was alarmed, and all Jerusalem with him. After assembling all the chief priests and experts in the law, he asked them where the Christ was to be born. “In Bethlehem of Judea,” they said, “for it is written this way by the prophet: ‘And you, Bethlehem, in the land of Judah, are in no way least among the rulers of Judah, for out of you will come a ruler who will shepherd my people Israel.’”
Herod then told the wise men to go to Bethlehem. But it was the supernatural movement of this heavenly star that drew them to the exact location where the child was.
Matthew 2:7-12: Then Herod privately summoned the wise men and determined from them when the star had appeared. He sent them to Bethlehem and said, “Go and look carefully for the child. When you find him, inform me so that I can go and worship him as well.” After listening to the king they left, and once again the star they saw when it rose led them until it stopped above the place where the child was. When they saw the star they shouted joyfully. As they came into the house and saw the child with Mary his mother, they bowed down and worshiped him. They opened their treasure boxes and gave him gifts of gold, frankincense, and myrrh. After being warned in a dream not to return to Herod, they went back by another route to their own country.
The star led them to the general direction of Jerusalem, and then it moved position till it came to the specific location in Bethlehem (about 5 miles south-east of Jerusalem, I think) where it stopped. The star did not lead them to Herod.
Paragraph 8 in this recent article (written by a Christian) may be relevant to your question. The article was prompted by the "great conjunction" of Jupiter and Saturn that's happening righ now. The last such conjunction took place in 1623 and the next one will be in 2080: https://wagingwisdom.com/2020/12/16/a-rare-astronomical-event-is-happening-this-christmas-is-it-the-star-of-bethlehem/
Yes, The magi were directed to Jerusalem and not Bethlehem. Then it was King Herod that directed them to Bethlehem. The next question is why would the star/God do that since obviously, God knew where Jesus was born? What that star did was set off a wicked King that once he found out about the prophecy proceeded to execute all children in the land below the age of 2 (Matthew 2:16). Would an all-loving God put those children in danger like that?