Jeremiah prophesies over the Philistines and Moab; Josiah dies in battle and is succeeded by Jehoahaz, who Egypt captures and replaces with Jehoiakim: Jeremiah 47–48; 2 Chronicles 35:20–27; 2 Kings 23:29–30; 2 Chronicles 36:1–5; 2 Kings 23:31–37
It was a tricky situation: the Egyptian army was going through Judah to fight the Assyrians. Any self-respecting king wouldn’t have been happy about his land being used as a highway for another army, especially one that was conquering as much of the surrounding land as it could, so Josiah set out to oppose Egypt. It was the logical thing to do.
Although a battle with Egypt was probably inevitable, and maybe this looked like a good strategic opportunity, it wasn’t God’s idea that it should happen then. Josiah was meddling in someone else’s war. The king of Egypt even made that point:
2 Chronicles 35:21What do you want with me, king of Judah? I have no quarrel with you today! I am on my way to fight another nation, and God has told me to hurry! Do not interfere with God, who is with me, or he will destroy you.
The result was devastating. Josiah was killed by an arrow, an indignity that Ahab also experienced, and Judah never recovered. Josiah was Judah’s last righteous king.