J.R.R. Tolkein, the author of The Hobbit and The Lord of The Rings, invented a word for “what makes a story, especially fairy stories, truly great. He called it eucatastrophe. A good catastrophe! He said it means, “the sudden happy turn in a story which pierces you with a joy that brings tears.” He likened the sudden relief that eucatastrophe brings to the snapping back into place of a limb that had been long put out of joint. Joyous relief” (https://www.fpcjackson.org/resource-library/sermons/eucatastrophe).
The Jews reading this story through their painful history, read this text with great delight, savoring every morsel of this eucatastrophe.
This is poetic justice, a fancy term for he got his comeuppance, his just desserts. What Haman planned to do to others was done to him. He was impaled on the gallows he had prepared for Mordecai and everything that was his is given over to Mordecai.