When Athaliah the mother of Ahaziah saw that her son was dead, she proceeded to destroy the whole royal family of the house of Judah.
References for 2 Chronicles 22:10
But Jehosheba, the daughter of King Jehoram, took Joash son of Ahaziah and stole him away from among the royal princes who were about to be murdered and put him and his nurse in a bedroom. Because Jehosheba, the daughter of King Jehoram and wife of the priest Jehoiada, was Ahaziah's sister, she hid the child from Athaliah so she could not kill him.
References for 2 Chronicles 22:11
He remained hidden with them at the temple of God for six years while Athaliah ruled the land.