Athaliah was the mother of Ahaziah. When she saw that her son was dead, she took over. She began by massacring the entire royal family.
But Jehosheba, daughter of King Joram and sister of Ahaziah, took Ahaziah's son Joash and kidnapped him from among the king's sons slated for slaughter. She hid him and his nurse in a private room away from Athaliah. He didn't get killed.
He was there with her, hidden away for six years in The Temple of God. Athaliah, oblivious to his existence, ruled the country.