Ahaziah's mother was named Athaliah, and she was enjoying her time on the throne as the Queen. When she heard that her son was dead, she knew she would have to give up that title, and she didn't want to.
II Chronicles 22:10- But when Athaliah the mother of Ahaziah saw that her son was dead, she arose and destroyed all the seed royal of the house of Judah.
This wicked woman killed all her son's children! Except one.
II Kings 11:2-3- But Jehosheba, the daughter of king Joram, sister of Ahaziah, took Joash the son of Ahaziah, and stole him from among the king's sons [which were] slain; and they hid him, even him and his nurse, in the bedchamber from Athaliah, so that he was not slain. And he was with her hid in the house of the LORD six years. And Athaliah did reign over the land.
There was one little baby who was saaved by Ahaziah's sister. She was married to one of the temple priests. She snuck the little baby boy into the temple and hid him for six years.
During this time Athaliah reigned as the evil queen.
II Chronicles 23:1-3- And in the seventh year Jehoiada strengthened himself, and took the captains of hundreds, Azariah the son of Jeroham, and Ishmael the son of Jehohanan, and Azariah the son of Obed, and Maaseiah the son of Adaiah, and Elishaphat the son of Zichri, into covenant with him. And they went about in Judah, and gathered the Levites out of all the cities of Judah, and the chief of the fathers of Israel, and they came to Jerusalem. And all the congregation made a covenant with the king in the house of God. And he said unto them, Behold, the king's son shall reign, as the LORD hath said of the sons of David.
When the baby was seven years old, the priest assembled as many of the leaders of the city as he could. They got together and decided to crown the boy as king.
Athaliah was so wicked that the people would rather a child rule over them!
The priest set up armed guards around the child. And then, he put armed guards around the doors and the gates. He also placed armed guards throughout the temple. Anyone who got too close to the boy king would be in for a surprise!
II Chronicles 23:10- And he set all the people, every man having his weapon in his hand, from the right side of the temple to the left side of the temple, along by the altar and the temple, by the king round about.
Now that the area was secure, it was time to crown the boy king.
II Chronicles 23:11- Then they brought out the king's son, and put upon him the crown, and gave him the testimony, and made him king. And Jehoiada and his sons anointed him, and said, God save the king.
People were so happy they were shouting, "God save the king!"
Well, all this noise made it up to the caste where the wicked queen was. She came out to see what was going on.
II Kings 11:13-14- And when Athaliah heard the noise of the guard and of the people, she came to the people into the temple of the LORD. And when she looked, behold, the king stood by a pillar, as the manner was, and the princes and the trumpeters by the king, and all the people of the land rejoiced, and blew with trumpets: and Athaliah rent her clothes, and cried, Treason, Treason.
Athaliah was shocked to see the people had crowned someone king. She thought that if she pointed out that it was treason that someone who kill the boy and she could remain queen.
What she didn't understand was that she was the one who had committed treason long ago!
II Chronicles 23:14-15- Then Jehoiada the priest brought out the captains of hundreds that were set over the host, and said unto them, Have her forth of the ranges: and whoso followeth her, let him be slain with the sword. For the priest said, Slay her not in the house of the LORD. So they laid hands on her; and when she was come to the entering of the horse gate by the king's house, they slew her there.
The priest commanded that the armed guards take the evil queen out of the temple and put her to death. The guards obeyed the priest.
II Kings 12:1-2- In the seventh year of Jehu Jehoash began to reign; and forty years reigned he in Jerusalem. And his mother's name was Zibiah of Beersheba. And Jehoash did that which was right in the sight of the LORD all his days wherein Jehoiada the priest instructed him.
Now, a seven year old can't really make decisions about how a nation should be governed. He has no idea about laws, or wars, or judgment. So, someone had to be an appointed ruler until he was old enough to rule by himself. Who do you think it was?
Of course it was the priest whose wife saved his life. It was probably the priest and his wife that raised the little boy until he was seven years old.
II Chronicles 23:16-17- And Jehoiada made a covenant between him, and between all the people, and between the king, that they should be the LORD'S people. Then all the people went to the house of Baal, and brake it down, and brake his altars and his images in pieces, and slew Mattan the priest of Baal before the altars.
The priest knew that the evil queen had followers who worshiped the same false idols that Ahab's family worshiped. He made a covenant with the people to promise to serve the Lord, and no false idols. The people were happy to comply and went and destroyed the building that the false idol was placed in.
II Chronicles 23:18-20- Also Jehoiada appointed the offices of the house of the LORD by the hand of the priests the Levites, whom David had distributed in the house of the LORD, to offer the burnt offerings of the LORD, as it is written in the law of Moses, with rejoicing and with singing, as it was ordained by David. And he set the porters at the gates of the house of the LORD, that none which was unclean in any thing should enter in. And he took the captains of hundreds, and the nobles, and the governors of the people, and all the people of the land, and brought down the king from the house of the LORD: and they came through the high gate into the king's house, and set the king upon the throne of the kingdom.
Jehoiada, the priest, wanted to make sure that everything was set up so that the people could worship the Lord the way they should. He made sure to follow the protocol that King David had set up for the temple court so long ago.
Then, he got the kingdom ready to protect their boy king.
II Chronicles 23:21- And all the people of the land rejoiced: and the city was quiet, after that they had slain Athaliah with the sword.