Athaliah was Ahab's sister, Jezebel's sister-in-law, Ahaziah's mother, Ahaziah's wife's aunt, Omri's daughter, Joash's grandmother and God's enemy (II Kings 8:26). My point in naming all those connections is to emphasize just how deep Omri and Ahab's influence had spread throughout Judaism. And, Athaliah was every bit as wicked as Jezebel had been. When she knew that Ahaziah (her son) was dead (killed by Jehu, the new king of Israel), she murdered every potential heir she could find. They were ALL her family members... most of them, her grandsons. The only survivors were her daughter Jehosheba and one of her grandsons, Joash... the infant son of the deceased king (II Kings 11:2).
When Joash was 7 years old, Jehoiada the priest carefully crowned him king over Judah. I say "carefully" because he did it in Solomon's Temple and under heavily armed security. When Athaliah heard the commotion, she came to see what was up. Upon discovering what was going on, she cried, "Treason," and fled for her life. The captains and officers knew what needed to be done to her and were willing to do it. They executed the murderous queen and thereby ended her influence in Judah. Not only that, the influence of Baalism in Jerusalem was also put down at that same time.