The consolation of fairy stories, the joy of the happy ending, or more correctly of the good catastrophe, the sudden joyous "turn" (for there is no true end to any fairy tale); this joy, which is one of the things which fairy stories can produce supremely well, is not essentially "escapist," nor "fugitive." In its fairy tale--or otherworld--setting, it is a sudden and miraculous grace, never to be counted on to recur. It does not deny the existence of dyscatastrophe, of sorrow and failure. The possibility of these is necessary to the joy of deliverance; it denies (in the face of such evidence, if you will) universal final defeat and in so far is evangelism, giving a fleeting glimpse of joy; joy beyond the walls of the world, poignant as grief.
Tolkien, "On Fairy-Stories", 1939
“It's like in the great stories, Mr. Frodo. The ones that really mattered. Full of darkness and danger they were. And sometimes you didn't want to know the end. Because how could the end be happy? How could the world go back to the way it was when so much bad had happened? But in the end, it’s only a passing thing, this shadow. Even darkness must pass. A new day will come. And when the sun shines it will shine out the clearer. Those were the stories that stayed with you. That meant something, even if you were too small to understand why. But I think, Mr. Frodo, I do understand. I know now. Folk in those stories had lots of chances of turning back, only they didn’t. They kept going, because they were holding on to something. That there is some good in this world, and it's worth fighting for.”
The Two Towers