The mood of The War of the Worlds quickly morphs from optimism to pessimism. At the beginning of the novel, Ogilvy and the narrator observe Mars during the 1894 opposition and speculate excitedly about the distant prospect of life on Mars. But soon the Martians invade and begin killing people. Ogilvy is especially optimistic and tries to assure the narrator that the force of gravity on earth will prevent the Martians from roaming freely, but then the Martians succeed in killing Ogilvy, and the mood of the novel becomes increasingly bleak.
At the end of the novel, when the narrator finds his wife and cousin, the mood quickly turns triumphant. In Book 2, Chapter 9, he describes his joyful discovery that they are still alive:
And there, amazed and afraid, even as I stood amazed and afraid, were my cousin and my wife – my wife white and tearless. She gave a faint cry.
‘I came,’ she said. ‘I knew – knew—’
She put her hand to her throat – swayed. I made a step forward, and caught her in my arms.
This final scene comes as a relief after pages of violence and desolation. The narrator's wife swoons into his arms, and he catches her in the chapter's last sentence. It seems as though he can barely believe what he sees; indeed, the whole party seems "amazed and afraid" at each others' presence. What might they be afraid of? Perhaps they fear that their reunion is only a dream. However, the physical reality of holding his wife in his arms assures the narrator that she is real.
The Epilogue, which directly follows this passage, has a slightly darker mood, as the narrator expresses fear of future invasions and struggles with traumatic memories of the Martians. This colder note is typical in the genre of science fiction, which usually presents a grave picture of humanity's future. By positioning a serious and speculative epilogue after a joyful scene of reunion, Wells sends the message that everything is okay for now and that humanity is out of harm's way unless it once more makes the mistake of taking its own safety for granted.