The Temple is finished, then Judah’s enemies stir up trouble when Xerxes becomes king of Persia, but Esther becomes queen and starts her efforts to prevent a genocide of her people: Ezra 6:14–22, 4:6; Esther 1:1–4:17
The Temple was finished in about 515 BC, and there seems to have been peace until 486 BC, when Xerxes became king of Persia, and Judah’s enemies thought they had an opportunity to make trouble. There’s no evidence they were successful initially.
A quick read of history suggests that Xerxes wasn’t the most attentive of kings. He failed in his attempts to subdue Greece, failed to pay enough attention to local gods and cultures to keep his subjects happy, and he embarked on a massive building program his treasury couldn’t afford. There’s not a lot of evidence of this king being actively engaged in good administration of his kingdom, which stretched from India to Cush.
So by 474 BC, Haman had become an advisor to this self-aggrandising king, and he probably thought he had a good chance of realising his dreams of a Jewish genocide. It would have seen the death of every Jew (as they were now known) in the middle east, including in Jerusalem.
It was only Esther’s intervention that saved them, as Mordecai pointed out:
Esther 4:13-14 Don’t think for a moment that because you’re in the palace you will escape when all other Jews are killed. If you keep quiet at a time like this, deliverance and relief for the Jews will arise from some other place, but you and your relatives will die. Who knows if perhaps you were made queen for just such a time as this?
Much of this happened at Xerxes’ winter palace at Susa.