In JRR Tolkien's essay On Fairy Stories (1947) he invented the word 'eucatastrophe' for the happy turn of events which, he argued, characterised the truest fairytale genre.
In a eucatastrophe (meaning 'good catastrophe') things become more and more terrible, until a bad outcome (catastrophe) seems inevitable. Then there is a joyous happening, some unexpected twist - an escape or victory snatched from the jaws of defeat; which produces a characteristic lift of the reader's heart and spirit.
Tolkien argues that this type of 'happy ending' (when done well) is a special and desirable quality; and one of the main reasons why someone might want to read fairy stories.
It might be supposed that - having already written the Hobbit, with its own eucatastrophic plot turn ("The eagles are coming!"), and happy ending - the eucatastrophe came naturally and spontaneously to Tolkien. But the evidence of his projections and drafts indicates that - on the contrary - his first thoughts on stories often led to unhappy endings - to the point of making an incoherent and unsatisfying plot.
I have already analysed the way that - from Tolkien's earliest work right through to the Notion Club Papers drafts of 1946 - he kept returning to the idea of a plot where a mariner nearly managed (after many perils and adventures) to sail to Elvenhome... but at the last moment, something prevented it, and he failed to get there.
This strikes me as unsatisfying as the end of any story; but more to the point, it fails to provide that eucatastrophe which Tolkien later regarded as the main feature of 'Fantasy' literature. Yet Tolkien's 'first thoughts' on plots often seemed to converge on this kind of failure.
I was reading Tolkien's plans for his unfinished time travel novel The Lost Road - which he worked on in 1937. The text and editorial discussion are found in Christopher Tolkien's The History of Middle Earth - Volume 5 (1987).
The projected story involved several 'reincarnations' of a Father-Son duo that recur throughout history, each forming a sub-story within the novel; each incarnation going backwards in time through actual human history, to reach the mythic last days and fall of Numenor. Numenor would be the climax; and, if there was to be one, that would be the eucatastrophe.
As I said, the story was not finished (less than 40 pages of novel, plus texts describing Numenor); however, Tolkien left some notes on how he intended to continue it - I am focusing on those listed on page 76. What I find striking is that Tolkien, here as so often, projected a messy, rather 'sordid' plot - with a disappointed and sad ending.
In the climactic Numenor story; JRR Tolkien wrote (as summarised by Christopher, quotes are from his father's notes, square brackets indicate my explanatory insertions):
Elendil spoke the phrase ["The Eagles of the Lord of the West"], but he was overheard, informed upon, and taken before [the King] Tarkalion, who declared that the title [Lord of the West] was his... The outcome of Elendil's arrest is not made clear... but it is said that [Elendil's son] Herendil is given command of one of the ships [built to invade Valinor], that when they reached Valinor Tarkalion set Elendil as a hostage in his son's ship, and that when they landed on the shores Herendil was struck down. Elendil rescued him and set him on shipboard, and 'pursued by the bolts of Tarkalion' they sailed back East. 'As they approach Numenor the world bends; they see the land slipping towards them'; and Elendil falls into the deep and is drowned.
Wow! What a stunningly miserable, depressing, unsatisfying ending to a projected novel! We go back and back in time, through father and son reincarnations; and to culminate there is a rather sordid, gangster-thriller-like plot about hostages and the son's treachery; and then it all finishes with Numenor destroyed and everybody killed!
Now, of course, Tolkien has second and third thoughts about this; and would surely have changed this radically if and when the book had ever been completed and published. But my point here is that Tolkien's first thoughts, his spontaneous 'instinct' for the story; was that it should end in total despair and destruction - about as far away from a eucatastrophe as can be imagined!
My understanding is therefore that Tolkien's natural, spontaneous tendency was to end his stories in disappointment and despair. The desirability, and perhaps necessity (at least for fairy stories) of a 'eucatastrophic' ending was, apparently, a relatively late discovery; hard-won, built on deep thought and personal experience; and something that went 'against the grain' of his own personality and instinct as a writer.