“Jehoshaphat, the king of Judah, came down.” The Bible does not give a reason that king Jehoshaphat of Judah would visit the wicked king Ahab. However, there is one very likely possibility. The annals of king Shalmaneser III of Assyria show that Ahab participated in a war that a coalition of 12 kings, including both Ahab of Israel and Ben-Hadad of Syria, fought against Assyria at Qarqar on the Orontes River. Although the Assyrian records claim the victory, that is almost certainly not the case since the Assyrians withdrew. The northern victory over Assyria would give Jehoshaphat a reason to visit Ahab because stopping Assyria would have been in his interest too. If Assyria took Israel, Judah would be attacked next, which is actually what happened, but later on in history (2 Kings 17-18).
Jehosaphat was reproved for joining this coalition (cp. 2 Chron. 19:1-3).
“the king of Israel.” This is Ahab (cp. 1 Kings 22:20).