Why did Tove Jansson, a gifted and dedicated artist who was born in Helsinki in 1914, start writing the Moomin books, a series that went on to sell in their millions, and be translated into 44 languages? Not for financial reasons, for she certainly did not envisage making much money from them. At least to begin with, she wrote them for herself. Through them she escaped from the war and the harshness of the world, at a time when many Finns were numbing their senses with drugs and alcohol. Writing about Moominvalley offered Tove an alternative escape from a life that was too cruel.

"It was the winter of war, in 1939. [My] work stood still; it felt completely pointless to try to create pictures. Perhaps it was understandable that I suddenly felt an urge to write down something that was to begin with 'Once upon a time'. What followed had to be a fairytale – that was inevitable – but I excused myself by avoiding princes, princesses and small children and chose instead my angry signature character from the cartoons, and called him the Moomintroll."

Tove, whose family were artists (her Finnish father was a sculptor and her Swedish mother an illustrator) had drawn Moomin-like figures before, as vignettes, small puzzle pictures or parts of her signature. They were separate and isolated, without their own narrative world, and were often black-bodied, red-eyed and skinny, with horns and long noses – the kind of creature you would not want to run into at night. Only later did these figures acquire their now-familiar looks: they became a lighter colour, put on weight and became chubby, easier for everyone to identify with.

The world of the Moomins was made up of sea, storms, rugged mountains and caves, but also of flowers and dense forest. Moominvalley was a homely, safe environment, along with its opposite as a backdrop to the adventures: an unpredictable and dangerous sea and a mountainous land prone to disasters. The Moomins always found it good to return from the great wide world to the calm of the valley back home. Though, of course, in order to return they had first to leave.

Tove Jansson's Finland Show all 5 1 /5 Tove Jansson's Finland Tove Jansson's Finland Tove Jansson's Finland Tove: a self portrait Tove Jansson's Finland Tove Jansson's Finland Tove's house (Kate Simon) Kate Simon Tove Jansson's Finland Tove Jansson's Finland Moomin gifts in a shop (Kate Simon) Kate Simon Tove Jansson's Finland Tove Jansson's Finland Tove's desk (Kate Simon) Kate Simon Tove Jansson's Finland Tove Jansson's Finland Writer's retreat: Tove and Tuuti pull ashore at Klovharu

Tove's recollections about the origins of the Moomins varied. The story often harked back to her early childhood, when she stayed with her mother's relatives in Sweden. There, she often crept into the pantry at night, prompting her uncle to warn about "moomintrolls" that lurked in the dark. In the 1930s, these creatures were frightening. In Tove's paintings of that decade, they sometimes appeared, for example, at the foot of sickbeds, and were undesirable in much the same way as head colds and angry concierges. She sometimes described them in her diaries as strange, ghostlike and scary creatures which the darkness of night had released from the shadowy forces of the subconscious.

Once, when Tove was asked about who it was that she wrote for, she replied that in the first instance she wrote more for herself than for children. "But if my stories are addressed to any particular kind of reader, then it's probably a Miffle. I mean those who have trouble fitting in anywhere, those who are on the outside, on the margins... the fish out of water. The good-for-nothing one has managed to escape from or conceal."

She said that nearly all the many readers' letters she got came from Miffles: children who were timid, anxious and lonely. The readers of the Moomin stories sought consolation in the Moomin world, and they found it. By admitting their joys and fears, Tove said, children could experience the things that grown-ups often forgot, like contact with simple things, a sense of safety, and its opposite, a corresponding pervasive fear. She did not want to shut out the mystery, tenderness and cruelty that were a part of the child's world: "In every honest children's book, I think there is an element of fear. Anxious and self-confident children alike are unconsciously drawn to it, and to destruction."

The inhabitants of Moominvalley often stray from their valley and are subject to storms and disasters on the raging sea. Tove loved the sea in its various manifestations. She described it in her life, in her painting, in the Moomin books and also in her other writing. The Moomins live in these two contrasting worlds: on the one hand, a luxuriant, marine landscape, with brooks, flowers, houses with tiled stoves; and on the other, the unpredictable sea with its barren islands, archipelagos, caves, mussels, sea creatures and boats. In the tension between these worlds, the Moomin family settles down.

While the idea for the world of the Moomins originated in the overwhelming days of the Winter War (a conflict between the Soviet Union and Finland that lasted from 1939-1940) and her first book, The Moomins and the Great Flood, was delivered to the publisher during the war, it appeared shortly after peace was declared. It was a time of considerable gloom and the future looked far from hopeful. The mood of this period was certainly reflected in the book's atmosphere of fear and menace, and also in its plot. While there can be no doubt that this is the story of a disaster, it also tells the story of the birth of a family.

A great flood has submerged the dry land and everyone is in mortal danger. It is an enormous environmental disaster, and the unpredictability of nature generates a sense of adventure and excitement. It is a typical picaresque tale. Moominpappa has disappeared with the Hattifatteners, and Moominmamma and Moomintroll set off to look for him. The family bond that unites the Moomin pair is a strong one, but it is also open-ended. Sniff joins the family. The Hemulens and Hattifatteners are also represented among the tribes of the Moomin world, and the core members of the Moomin family are assembled. In a happy ending, the Moomins regain the calm of their beautiful valley. The adventure is over, and life can begin again.

Tove's second Moomin book, Comet in Moominland (1946), was also born in the shadow of war. Although it is not really a war novel, it is a book about great disasters. In it, the Moomins continue their encounters with natural forces and disasters, but these are now even more violent, and occur at an even more rapid pace. The action progresses through familiar landscapes, from the peaceful Moominvalley to scenes of destruction and horror echoing the Bible: a comet is rushing towards the Earth, threatening to destroy the Moomin world, and with it the world as a whole. As the comet comes closer, the Earth heats up and the natural world is turned upside down: the seas recede and dry up, locusts arrive from Egypt and hurricanes rage.

By the time the comet finally crashes to Earth, the family has moved to a cave that they have insulated from the overheated, red-hot world. Surrounded by thundering, banging and hissing, their life in the cave is unpleasant, and they have no idea of what is happening outside:

"The whole mountain shook and trembled around them and the comet howled as if terrified, or as if the Earth itself was screaming.

"They lay still and held on to one another for a long time. From outside came the rolling echo of shattering rocks and soil. Time became dreadfully elongated, and each of them felt they were quite alone."

These moments of terror are described with a realism that only an author who had experienced something similar could have achieved. During heavy air raids, it was nerve-wracking not to know what was happening outside. If the raids went on for a long time, it was all too easy to believe that everything outside had been destroyed. The atomic bombs that were dropped on Hiroshima and Nagasaki in 1945 made the prospect of global destruction real. They meant that there was something even worse than what Finland had experienced during its wars. The possibility of global nuclear conflict caused shock, and it affected people all over the world.

Much of this had a direct effect on Moominvalley. The knowledge that the world could be destroyed by just the push of a button certainly influenced the books. The threat of total annihilation is therefore a major theme and a highly original one in a book for children.

The description of the change in the natural environment reads as though it came from news reports of the nuclear explosions. In the story, the air becomes intolerably hot and the sky a fiery red. It looks as though life will not be possible for much longer, and only a cave can save the travelling Moomins. They go deep inside the mountain and stay there, without knowing whether anything of the Earth remains.

It is wonderful news when they learn that the world has not been destroyed. The evil is in the past and the sky is blue again – the hot, red world was a nightmare that is now over. There is a sense of "all's well that ends well", of the happy ending that children deserved: "The sky, the sun and the mountain are still there, she said solemnly. And the sea, Moomintroll whispered." Snufkin's mouth organ has all its notes again, and he plays it happily. As in Moominland, so in Finland – this is surely how the Finns would feel when the war was over and they were able to continue their lives.

Even in these early works, it is plain that Tove's narrative operates on several levels. It is a quality that lies at the basis of all the Moomin books and makes them quite unique in children's literature. It was also the case that some bewildered publishers were unable to conceive of books that might be suitable for both children and adults.

When her books were first published, there was also discussion about their suitability in an educational context. The Moomins' language, their drinking of palm wine and smoking of tobacco gave offence. What's more, the Moomins often said rude things and even swore at times. Later, in the 1970s, the Moomins prompted disapproval in Finland as they were seen as portraying an excessively bourgeois view of the family.

The author made no bones about her intent: "I write in order to amuse – but not to educate." She said she had no philosophy or political tendency. She simply wanted to describe things that had fascinated or frightened her, and had made everything "take place around a family that is perhaps best characterised by a kind of benign confusion, an acceptance of the world around them, and by the fact that they all get along extraordinarily well with one another".

This is an edited extract from 'Tove Jansson: Work and Love', by Tuula Karjalainen (Particular Books, £20), which is published on Thursday

Tove and her place in the moomin family

Elements of Tove are present in every creature she created for the Moomin world. Tove often said that Moomintroll was her alter ego. Tove often drew this small creature in her letters and as an addition to her signature. Although Moomintroll may not be the quaintest or most colourful of Moominvalley's inhabitants, he is its central figure: everyone is related to him. Tove also comprised a good deal of Little My, a character who does not mince her words, and whose sharp tongue often speaks the truth. Little My always says everything that's on her mind, even things that no one really wants to hear, but that are true and often made better for having been said. She is very eccentric – cheerful, angry, slightly mischievous and sometimes malicious, for example when she bites others on the leg or tail and then has a good laugh about it. She plays tricks, cracks jokes, and in many ways resembles the dwarfs and court jesters of former times. Truly tiny, she measures only one-thousandth of a millimetre – so small one needs a magnifying glass to see her.