The sudden death of King Josiah left a deep mark on the nation and led to widespread mourning. Guided by the prophet Jeremiah, this period of grief became a permanent part of the historical memory and lamentation traditions of the Israelites.
Professional male and female vocalists were called upon to lead the people in their sorrow. Although singing is usually associated with joy, the act of raising a voice to a musical tune applies just as much to wailing and mourning [רש״י, מצודת דוד]. This transformation of joyful music into bitter weeping echoes the ancient prophecy of Amos, who warned of a sun setting at noon and songs turning to sorrow. This imagery captures the tragedy of Josiah's unexpected death at the age of thirty-nine, exactly halfway through a standard human lifespan [רש״י].
The mourning for the king was not merely a passing event but was established as a permanent historical custom. A formal practice was instituted for future generations: whenever a tragedy would strike and the Israelites needed to weep over a painful event, the mourners would weave their ongoing sorrow over Josiah's death into their new lamentations [רש״י, מצודת דוד, ביאור שטיינזלץ]. This practice mirrors other historical traditions of grief, such as remembering various national disasters during the mourning period of the Ninth of Av, or the ancient custom of weeping for the daughter of Jephthah [רש״י].
These expressions of grief were eventually recorded for posterity. The primary approach among commentators is that they were compiled into the biblical Book of Lamentations. Within this text, the specific description of the anointed of God being caught in their traps is understood to be Jeremiah's direct eulogy for Josiah, who tragically died because of the sins of his generation [רלב״ג, רד״ק]. Alternatively, another perspective suggests that there was once a separate, dedicated book of laments that exclusively contained the elegies composed for the fallen king [רלב״ג].