The tough thing about writing fiction — one of the tough things, anyway — is that the events in a story or novel need to make some sort of sense. What sort of sense the events make will depend on the author’s views; Ayn Rand’s version of a world that makes sense is quite different from C. S. Lewis’s, and neither of their versions bears much resemblance to my own. What they have in common is that their fiction is, in each case, an attempt to convince readers that the messy and pointless real world has a hidden moral order.
Real life always escapes from the net of making sense, sometimes by ripping large holes in the net. In the last analysis, the task of the fiction writer is to gin up an imaginary world that, by being limited and having some sort of moral orientation, actually does make sense.
Fiction comforts us by allowing us to bask in the illusion that we live in a world that makes sense. Even as extreme an example as Alice’s Adventures in Wonderland follows this template. At the end, Alice wakes up! The subtext of the story — and remember, Charles Dodgson was a clergyman — is that we can indulge in arbitrary flights of fancy, but that ultimately we will be brought back quite safely to a place that’s comfortingly familiar.