Are you sitting comfortably? Then let us begin.

Or rather, let us press a button and leave the room. One in four parents have now delegated bedtime story-reading to a digital assistant like Alexa, according to a depressing little survey published this week, while two-thirds admit letting their children have screen time instead. For the genuinely burned-out parent, maybe it makes sense. But I do wonder what Judith Kerr – the much-loved author of The Tiger Who Came to Tea, the Mog series and other books no child should be without – would have made of it.

For those whose children are too grownup now to be read to at bedtime, she is a poignant reminder of what is gone

Her death this week has led to an outpouring of public sadness, that puzzling kind of grief felt for a stranger who turns out to have meant more than you knew. Partly it’s because her stories are so inextricably associated with the most intimate part of the parental day, that drowsy moment when they suddenly start talking about whatever has been on their minds all day. Darkness is falling, but somehow a story makes everything all right. And for those whose children are too grownup now to be read to at bedtime, she is a particularly poignant reminder of what is gone. When they’re tiny you long to skip to the end of the chapter, not realising how you’ll miss it when the book closes for good.

But this weekend of all weekends, as we wait to find out how far hard-right anti-immigrant parties have advanced into the heart of European politics, the sense of loss perhaps has something to do with the triumph of good over evil Judith Kerr’s life represented. She was nine when her family fled Germany, just before Hitler came to power; not only were they Jews but her father, a theatre critic, had publicly mocked the Nazis. Her parents clearly tried to shield Kerr and her brother from the struggles of exile, encouraging them to see leaving Berlin as an adventure, and she was always at pains to point out that she had no traumatic memories of the Gestapo breaking down the door. But still, it cannot have been an easy childhood. Her mother suffered from depression, trying several times to kill herself, and her writer father struggled with the frustration of living in a country where he couldn’t speak the language.

Judith Kerr – and tiger – at the BookTrust Lifetime Achievement Award, London Zoo, in 2016. Photograph: Guy Bell/REX/Shutterstock

Yet Kerr resisted easy sympathy, just as she always gently resisted overly adult interpretations of her most famous book. No, she would say, the tiger who causes havoc by turning up unexpectedly for tea with a little girl and her mummy didn’t symbolise the Nazis; nor did he represent wild 1970s sexuality disrupting cosy domesticity, the mother’s secret lover, or even depression. The tiger is just a tiger, inspired by the ones Kerr’s daughter loved watching at the zoo. Her books created a place of wonder but also of safety for children, and her genius was in knowing just how far to let darkness in.

Kerr did not shut out sadness, so much as gently introduce readers to its existence and then soothe the pain away. Goodbye Mog, the book in which the cat finally dies, has helped countless children grasp the idea of grief and loss. The author’s own life could so easily have been filled with it, had her family not got out when it did, yet still she chose to spend her time creating something that sent millions of children drifting off to sleep feeling safe, happy and loved. What extraordinary generosity.

Knowing what might happen to a nine-year-old trapped inside a murderous regime today, it’s sorely tempting to turn her life story into an impassioned argument for taking in refugees. It is so obvious what Britain would have lost by turning our back on those fleeing Germany: Judith Kerr became a national treasure, her brother Michael an appeal court judge.

But beware setting up the “good” refugee – the one who turns out to be Albert Einstein – against the one who does nothing much with his life. Had Kerr never written anything longer than a note to the milkman it would still have been right to shelter her family from the Nazis, for the moral obligation is on host countries to respond to mortal threat, rather than on refugees to repay a debt with future achievements, however strongly some will want to. Sometimes a tiger is just a tiger, and sometimes a frightened refugee is just a frightened refugee – but no less deserving of asylum for it.

If there is a moral to this story, it is rather to remember that even when the world feels as dark and as threatening as it does right now, there is still good to be found. It’s been there all week, in the testimony emerging from the London Bridge terror attack inquest, full of the courage and heroism displayed by ordinary people caught up in the horror, just as it is in Kerr’s account of the many individuals along the way who helped her parents escape. When it comes to the crunch, more people than you would imagine strive to do the right thing and deserve to be celebrated for it. These are the stories to tell ourselves, when darkness is falling all around.

• Gaby Hinsliff is a Guardian columnist