At this point, Ahab was Israel's king; Jehoshaphat was Judah's king. Ahab invited Jehoshaphat to join him in fighting against the king of Syria. And surprisingly, Jehoshaphat agreed to make a league with wicked Ahab.
Now, Jehoshaphat wisely asked his host to seek for the Lord's guidance before they went into battle. It is a puzzle why he did that, since even when Jehoshaphat had God's word in this instance, he didn't change his plans. The ridiculous proceedings which followed Jehoshaphat's request indicates just how wicked Ahab was. Ahab listened to his 400 false prophets and specifically to Zedekiah, one of the false prophets. Instead of telling Ahab the truth, these all told him things which they knew that he wanted to hear, that is, that he most surely would win.
However, due to the insistence of Jehoshaphat, they brought a true prophet of God named Micaiah, who briefly and boldly revealed the truth about the destiny of Ahab. So, Ahab disguised himself before he went into battle, but he died anyway… just as God's man had predicted. God used a randomly shot arrow to put an end to Ahab's evil reign (2nd Chronicles 18:33). Incidentally, Jehoshaphat was (at the same time) providentially protected while on the battlefield.