This chapter describes the coup, the usurpation of the throne of Judah by the house of Ahab, which took place after the death of Ahaziah the grandson of Jehoshaphat.
Jehoshaphat had made an alliance with Ahab, the king of Israel, for which the LORD reproved him (2 Chr 19:2). In it, he betrothed his son and heir, Jehoram, to Ahab’s daughter Athaliah. I am sure Jehoshaphat was thinking that by it, he could unite the two kingdoms together under the house of David again. But God had a plan for reuniting the two kingdoms together under the house of David — a much greater, grander plan! And this was not it.
Bunny trail: please note that we never accomplish the will of the LORD by violating the word of the LORD! Jehoshaphat could not accomplish the reunification of the two kingdoms, as noble a cause as that is, by joining together unlike kinds, godly seed in Jehoram with ungodly seed in Athaliah. The result was a complete and utter failure, and an open door for the enemy to work destruction and apostasy in Judah as he had been in Israel!
So Jehoram reigned in the place of his father, however, the righteous did not turn the heart of the wicked to righteousness, but the wicked turned the heart of the righteous to wickedness! Athaliah corrupted Jehoram and he introduced all the evil of the house of Ahab into Judah. When he died, his son Ahaziah walked in his footsteps. Ahaziah was killed by Jehu according to the word of the LORD. Then his mother. the wicked Athaliah, proceeded to seize the throne of Judah also, and killed all Ahaziah’s young sons, her own grandchildren, in order to prevent any seed of the house of David from coming later to wrest the throne from her.
However, the youngest baby escaped, and he remained hidden in the Temple of the LORD, raised by the high priest and his wife, who was the baby’s aunt. So the wicked house of Ahab had usurped the throne of Judah from David, and was defiling the land with the same wickedness that had polluted Israel. This is the terrible state of affairs that existed in Judah at the end of 2 Chr 22.