The sudden death of a monarch often leaves a volatile power vacuum in its wake. After King Josiah was fatally wounded in battle at Megiddo, his body was brought back to Jerusalem. His servants laid him to rest in the royal tombs, placing him in a specific plot he had personally prepared for himself while he was still alive [מצודת דוד, רד״ק].
Immediately following the burial, the common people intervened to control the transition of power, seizing Josiah's son Jehoahaz to crown him king. The new king was formally anointed with oil, an action that was highly unusual. Under normal circumstances, a king who inherits the throne directly from his father does not require anointing. The primary approach among commentators is that this anointing signaled a deep political dispute and a break from standard royal succession. Jehoahaz was neither the firstborn nor the natural heir. His brother Jehoiakim was two years older—a fact proven by their respective ages when taking power: Jehoahaz assumed the throne at twenty-three and ruled for only three months, whereas Jehoiakim was twenty-five when he replaced him. Because Jehoahaz lacked the legal right of the firstborn, the people had to take him by force and install him on the throne aggressively [רש״י, רד״ק, רלב״ג, מלבי״ם].
Why the public favored the younger brother remains a matter of debate. One perspective suggests that the people chose Jehoahaz because he was the only son truly suited to follow in the footsteps of his righteous father, unlike Jehoiakim. In this view, his moral fitness made him the rightful royal heir, even if he lacked the biological claim [רד״ק]. Conversely, another viewpoint argues that the people acted improperly. By bypassing the actual firstborn, Johanan, who might have maintained his father's righteous path, they deliberately elevated Jehoahaz, a man who leaned toward improper behavior [רלב״ג].
Adding to this complicated political landscape, a separate tradition suggests that Josiah had actually crowned a different son, Zedekiah, before his death. However, once Josiah died, the people rejected Zedekiah, rebelled against the late king's explicit wishes, and placed Jehoahaz on the throne instead [רד״ק].