In this chapter, Athaliah claims the throne and is unseated by the legitimate king, Joash.
Verse 1 starts off on a dramatic note. After Jehu kills Ahaziah, who was the king of Judah, Ahaziah's mother kills all of the other "royal offspring", basically anyone who could inherit the throne. The first question we have to address is why Athaliah would do this, since we do not have an obvious motive. Here is my guess at an answer. Athaliah's husband, Joram, likely had many wives and sons from these other women. It is probable that Athaliah only had a single son with Joram, Ahaziah, who became king. When Ahaziah died, it's possible that the throne would have passed to another one of Joram's sons and not a descendant of Athaliah. We know from verse 2 that Ahaziah had a surviving son, who seems like a logical choice for the next king, but it's possible that it would have gone to Ahaziah's oldest brother instead of his son, in which case Athaliah's dynasty would be over.
However, given that Athaliah appears intent on killing Joash as well, it seems that Athaliah may have simply been interested in taking the throne for herself with no intent to build a dynasty of any kind.
A second thing to note in this chapter is how the rough-and-tumble Israelite (northern kingdom) politics is starting to infiltrate Judah (southern kingdom) now that a king of Judah married a woman from Israel. In the past book or so, what we saw in Judah was a long sequence of orderly succession with the kingship passing from father to son. In Israel, there have been numerous coups, often involving the murder of the entire family, relatives and friends of the previous king. Athaliah has clearly been raised in that kind of culture, and takes Ahaziah's death as an excuse to start murdering children that could potentially oppose her. Besides the idolatry, this is another reason why Judah's alliance with Israel is such a bad idea.
From verse 2 we can see that Athaliah is not sparing even her own grandchildren. However, one of Ahaziah's sons is hidden in the temple, which is a safe place from Athaliah both because the temple has regulations against non-Levites from entering it and because Athaliah worships Baal and is unlikely to even want to go to the temple.
In verse 4 we can see the amount of secrecy required because if Athaliah heard that Joash was still alive, not only would she go and kill Joash but probably also kill the priests who have been protecting him. Nevertheless, Joash is made king, and when Athaliah arrived at the temple she is immediately put to death. Athaliah was definitely a supporter of Baal worship, and after her death the people follow Jehoiada and destroy the temple of Baal. Jehoiada is a priest of the LORD, so that's why he is the instigator of many policies in favor of the LORD's temple over Baal. For instance, in v. 17 it tells us that he first establishes a covenant between the people and the LORD, and then secondly with the king. It is almost certainly at Jehoiada's urging that the people go and destroy their altars to Baal.
In the very last verse, we learn that Joash is seven years old when he becomes king, which explains why most of the action is directed by Jehoiada. Indeed, for most of Joash's kingship he is going to operate with considerable guidance and oversight from the older statesmen and priests who surround him. More than almost any other king, Joash's kingship is defined by the people in power around him, rather than the king himself. Since it was Jehoiada who made Joash king, Jehoiada will end up being one of the most (if not the most) influential person through all of Joash's reign. For a similar story, see 2nd Samuel chapters two and three.