Jehoiada became the brother-in-law of King Ahaziah as a result of his marriage with princess Jehosheba.
[1] Both Jehosheba and Ahaziah were children of King Jehoram of Judah (reigned c. 849 – 842 BCE).
Ahaziah died a year after assuming the throne, which was then usurped by his mother Athaliah, who ordered the execution of all members of the royal family.
According to the medieval chronicle Seder Olam Zutta (804 CE), Jehoiada was a High priest.
Bench, Clayton H. The Coup of Jehoiada and the Fall of Athaliah: The Discourses and Textual Production of 2 Kings 11.