The Dead Marshes are an ancient battlefield (Battle of Dagorlad), outside of Mordor. The last alliance fought the forces of Mordor and it was here that many of the fallen had laid to rest. Through the years, the battlefield became marshes and swallowed up the dead. Frodo, Sam, and Gollum took a passage through "The Dead Marshes". Candles and lights danced about and Frodo was mesmerized by the lights and tried to reach out and touch the faces of the dead, at the bottom of the marshes. Gollum told them that the dead could not be touched, suggesting that he had once tried to eat them.
Barbara Strachey, in her fictionalised atlas Journeys of Frodo, depicts the Dead Marshes as an eastward extension of the swamps of Nindalf (Wetwang), although on the Lord of the Rings map they appear separate.
In The Letters of J.R.R. Tolkien, Tolkien speculated that the description of the Dead Marshes may have been based on his personal experience in World War I, specifically, the Battle of the Somme (when it rained, blast craters in no-man's land would become a series of pools or lakes with bodies of dead soldiers, from both sides, floating in them)