Via Glenn Reynolds, I was quite taken with Belmont Club Richard Fernandez’s analysis of the role of religion in war:

In those dark days faith, like freedom was sometimes just another name for nothing left to lose. And yet it was not altogether meaningless: it made the margin between victory and defeat.
But perhaps the West, cushioned by its material wealth, has altogether too much to lose for it to care about faith or freedom any more. Mark Steyn, currently touring Australia on a speaking tour, asks whether the West can rouse itself from ennui just long enough to feel the knife at its throat. And the horrifying thing is that Steyn on the hustings swings his lamp and cheerfully calls out for company in a dark, unanswering cultural night made all the more tenebrous by the bright Antipodean sunshine. What Deity, race or tribe might we still raise against the horde of Basiji?
My own guess is that neither Israel nor the West at large can long resist radical Islam without some sustaining faith of its own, a faith it will not find unless it makes up its mind to look for it. Men will fight on for as long as there is something left to fight for and not otherwise. Despair comes when we are finally convinced that even our hopes are futile.

Such sustaining faith need not take the form of conventional religion. Unconventional religions will work, as will deeply held belief systems of any sort. But to hold something deeply there has to be something to hold.
This is a point that the most calculating and cynical of atheists have recognized. I can’t think of a better example than Joseph Stalin’s literal resurrection of the Russian Orthodox Church he had sworn to destroy, and which he had nearly destroyed:

Continuous persecution in the 1930s resulted in its near-extinction: by 1939, active parishes numbered in the low hundreds (down from 54,000 in 1917)

But Russia in the 1940s, on the verge of losing everything to Nazi Germany, was in the midst of “times that try men’s souls.” All the more difficult for soulless Stalin and his equally soulless top Bolsheviks to face, for what can be worse the trying of a soul you don’t believe in?
Things couldn’t have been bleaker. Atheist that he was, Stalin recognized that Communism couldn’t possibly provide a sustaining faith for most ordinary Russians. He knew that unless he saw to it that God was solidly on their side, Russia would lose the war.
And so the cynical, evil, godless Stalin held a meeting with the church hierarchs, and opened the churches:

…the Nazis? obsession with the plan to wipe out this country as a nation turned the world war into a patriotic one. So it was natural that in a bid to overpower the enemy the nation turned to their imperial tradition and to Russian history. The Orthodoxy was the Russian man?s main spiritual basis. Stalin just couldn?t fail to realize this, so it is small wonder that he sought assistance from the Church during that dangerous period of time in this country?s history.
20,000 churches were opened during the war years. In spring 1942 Soviet Government allowed Easter celebrations for the first time in many years. On September 4th 1943 Stalin invited the hierarchs of the Russian Orthodox Church to the Kremlin to discuss the need for reviving religious life in the USSR and the speedy election of a Patriarch.

There’s even a book titled “Stalin’s Holy War.”
Of course, Stalin’s situation was utterly desperate, as was Russia’s.
Avoiding despair during desperate times will try anyone’s soul.
You don’t even have to have one.
MORE: Already I see that a commenter thinks I advocate embracing religious fanaticism. Actually, I was making a historical point. But to each his own.
I should endeavor to be more open to misinterpretation.