Mordecai tried to hide Esther from the empire before the empire could see her.
When the royal decree gathered young women to Shushan, Targum Sheni on (Esther 2:8) says Mordecai withdrew Esther from the royal messengers and hid her in a summer house. Other women displayed themselves at the windows when the messengers passed. Esther was concealed.
The concealment could not last. The messengers realized that the most beautiful woman in the province was missing. They reported it to the king, and Ahasuerus issued a deadly order: any woman who hid from the royal search would be punished with death.
Mordecai is caught between protection and danger. Keeping Esther hidden may save her from the palace, but it may also get her killed. He brings her into the marketplace, and she is taken to Hegai, keeper of the women.
The targum makes Esther's rise feel less like ambition and more like capture. Providence will work through the palace, but first the palace must take her. Hiddenness is her first defense, and also the sign that her destiny is not in her own hands.
Now when the royal decrees were made known, and virgins were gathered to Shushan through Hega the royal eunuch and keeper of the women, and when Mordecai heard that virgins were forcibly demanded, he took Esther and withdrew her from the royal messengers, that they should not carry her away. He hid her in a summer-house, that they should not see her. The daughters of the heathen used to dance and show their beauty through the windows when the royal messengers passed by, therefore the messengers brought many virgins from the provinces. And the messengers knew Esther, and when they saw that she was not among these virgins, they said one to another: "In vain have we exerted ourselves to bring virgins from the provinces, when we have in our province a virgin who surpasses in beauty all those whom we have brought." And when search was made for Esther and she was not found, they made it known to the king. When the king heard it, he issued an order that every virgin who shall conceal herself from the royal messengers, shall be punished with death. Mordecai, hearing this order, was afraid, and he conducted his uncle's daughter to the market, and so Esther was brought by Hega, the keeper of the women, unto the king.