1 Kings 22:36

And there went a proclamation throughout the host about the going down of the sun, saying, Every man to his city, and every man to his own country.

About the going down of the sun a proclamation went throughout the host ending the battle and sending every man back to his own city and his own country.
The dismissal of the army to its cities and countries and homes went out after Ahab had died in the battle, killed and fatally wounded there.
He died in battle against the Syrians, at their hands.
His death in that battle came less than three years after Elijah announced judgment upon him and his house.

The scattering of the army in that proclamation fulfilled Micaiah's warning word.
Micaiah had warned that Israel would be scattered with no king to lead them and would return home, and the soldiers did return home in peace.
His message had told the kings that their battle plan was not favored by heaven, but they rejected the truth and followed their own judgment.
Had Ahab accepted the message he could have been saved.

The account of Ahab's death was witnessed by Ahaziah and stood as a fearful warning of the consequences of defying God's law.
Though Ahaziah knew this evidence, he treated it as an idle tale and continued in idolatry.