In a program of the BBC the daughter of the late J.R.R. Tolkien told about her supposition 
that the Journey through the Dead Marshes in 'The Lord of the Rings' was in fact a 
description of the experiences her father had in The Great War. 

During that First World War Tolkien was a second leutenant in the 11th Lancashire 
Fusiliers. He served in action as Batallion Signalling Officer. From July 14th 1916 
on he particated in the Battle of the Somme (on the first of July, when the battle 
started, his battalion remained in reserve).

He started with an unsuccesful attack on the village of Ovillers . Many of his battalion were killed by machine gun fire. Among them some of his dearest friends. 

After that Tolkien particpated in at least one of the disastrous stormings of the Schwaben Redoubt, a German fortification, and he served on and off in the trenches.

While many of companions died, he remained unharmed, until he fell ill with severe trench fever at the end of October 1916. He was brought to an army hospital in Great Haywood in England. He became sick many times after that, which prevented his return to the battlefields. While he stayed in the hospitals he started writing The Book of Lost Tales, that eventually would become The Silmarillon. 

In spring 1918 he received news that those of his battalion who were still serving in France, were all killed or taken prisoner at the battle of the Chemin des Dames. In the Foreword of The Lord of the Rings he writes: "By 1918 all but one of my close friends were dead".

The Journey through the Dead Marshes in The Lord of the Rings looks like a description 
of the marshy and swampy battlefield in Flanders. In the course of the war the 
surroundings of the city of Ypres were transformed into a deadly mud swamp with 
slithery clay and shell holes filled with water. Countless soldiers drowned in these 
treacherous pits. 

Tolkien himself did not fight in Flanders, but doubtless he has heard many stories
about this hell while he stayed in the army hospitals and later.

In the first sentence in the Foreword of The Lord of the Rings Tolkien describes his book as "a history of the Great War of the Ring". And many years later, discussing the principal characters in this novel, he writes: "My Sam Gamgee is indeed a reflexion of the English soldier, of the privates and batmen I knew in the 1914 war, and recognized as so far superior to myself".

Who reads the fragment below cannot escape the reference to the Great War

The Journey through The Marshes

They had come to the very midst of the Dead Marshes, and it was dark.

They walked slowly, stooping, keeping close in line, following attentively every move that
Gollum made. The fens grew more wet, opening into wide stagnant meres, among which it 
grew more and more difficult to find the firmer places where feet could tread without 
sinking into gurgling mud. The travellers were light, or maybe none of them would ever
have found a way trough.

Presently it grew altogether dark: the air itself seemed black and heavy to breathe.
When light apperared Sam rubbed his eyes: he thought his head was going queer. 
He first saw one with the corner of his left eye, a wisp of pale sheen that faded 
away; but others appeared soon after: some like dimly shining smoke, some like
misty flames flickering slowly above unseen candles; here and there they twisted 
like ghostly sheets unfurled by hidden hands. But neither of his companions spoke a word. 

At last Same could bear it no longer. "What's all this, Gollum?' he said in a whisper.
"These lights? They're all round us now. Are we trapped? Who are they?'

Gollum looked up. A dark water was before him, and he was crawling on the ground,
this way and that, doubtful of the way. 'Yes, they are all round us,' he whispered. 
'The tricksy lights. Candles of corpses, yes, yes. Don't you heed them! Don't look!
Don't follow them! Where's the master?' 

Sam looked back and found that Frodo had lagged again. He could not see him. 
He went some paces back in the darkness, not daring to move far, or to call in
more that a hoarse whisper. Suddenly he stumbled against Frodo, who was standing 
lost in thought, looking at the pale lights. His hands hung stiff at his sides; 
water and slime were diping from them. 

'Come, Mr. Frodo!'said Sam. 'Don't look at them! Gollum says we mustn't. Let's
keep up with him and get out of this cursed place as quick as we can - if we can!' 

'All right,' said Frodo, as if returning out of a dream. 'I'm coming. Go on!' 

Hurrying forward again, Sam tripped, catching his foot in some old root or tussock. 
He fell and came heavily on his hands, which sank deep into sticky ooze, so that his 
face was brought colse to the surface of the dark mere. There was a faint hiss, a 
noisome smell went up, the lights flickered and danced and swirled. For a moment 
the water below him looked like some window, glazed with grimy glass, through which 
he was peering. Wrenching his hands out of the bog, he sprang back with a cray. 
'There are dead things, dead faces in the water,' he said with horror. 'Dead faces!' 

Gollum laughed. 'The Dead Marshes, yes, yes: that is their names.' he cackled. '
You should not look in when the candles are lit.' 

'Who are they? What are they?' asked Sam shuddering, turning to Frodo, who was 
now behind him. 

'I don't know,' said Frodo in a dreamlike voice. 'But I have seen them too. 
In the pools when the candles were lit. They lie in all the pools, pale faces, 
deep deep under the dark water. I saw them: grim faces and evil, and noble faces 
and sad. Many faces proud and fair and weeds in their silver hair. But all foul,
all routting, all dead. A fell light is in them.' Frodo hid his eyes in his hands.
'I know not who they are; but I thought I saw there Men and Elves, and Orcs beside them.' 

"Yes, yes,' said Gollum. 'All dead, all rotten. Elves and Men and Orcs. 
The Dead Marshes. There was a great battle long ago....'