A saga that has gripped so many began almost three weeks ago, when 12 boys and their football coach slipped into a cave in northern Thailand to explore one afternoon, and were trapped by fast-rising waters. It ended on Tuesday with the announcement that all were now free and safe. As 13 families celebrate, one more is mourning: Saman Gunan, a former Thai navy diver, lost his life in the rescue effort. And while the boys are well enough to request their favourite meal and not too much homework, the months ahead will offer challenges as daunting in their way as the recent ordeal.

Nonetheless, the jubilation around the world is real and heartfelt. This was a saga in its unfolding: 18 days is a long time in a world of social media and rolling news; and they encompassed dimming hopes, a sudden discovery, and the race against time to save the boys and their coach. In myth and folklore, caves are both enticing and forbidding, often invoked as the gateway into another world; children straying into jeopardy is another recurrent theme. Yet what made this story so powerful and absorbing was seeing humanity at its best: this is a tale of innocence protected; of perseverance against the odds and heroism in the face of danger; above all, of triumph over despair.

It speaks to us unusually strongly now, as the antithesis of the worst we see all around us. The boys themselves, with their coach’s encouragement, have shown extraordinary fortitude. At a moment of rising division, the rescue has been a model of international collaboration. US military personnel, British rescue experts and specialists from China, Australia and Japan have worked alongside the Thai authorities and people. In an era of greed, many involved are unpaid volunteers. In an age of narcissism, they have shunned the spotlight. There has been very little showboating (though Donald Trump, whose administration has separated so many children from their parents, made a late bid to take credit).

Nor has there been finger-pointing; even as she waited for her son to emerge, the mother of one 14-year-old player wrote to reassure the coach: “No parents are angry with you at all, so don’t you worry about that.”

For Thailand, this is about a nation uniting in concern and then delight; for its leaders, a welcome story of the centre coming to the aid of its people. National stories are never apolitical, and even less so when a country is so fractured and still under the control of a military junta. Outsiders, too, choose the stories they want. By contrast with the cave boys, the deaths of at least 41 Chinese tourists, including children, in a boat disaster in southern Thailand have had strikingly little attention.

The rescue’s physical complexity was matched by its moral simplicity: with no political debates or narrow interests at stake, everyone could root for the trapped boys – but many more children worldwide need help, and could have it at a fraction of this cost and effort. The unscrupulous can use such cases to overshadow the needs of the vulnerable elsewhere. The rest of us can allow the rare good news to lull us into complacency, reassuring us that someone else will save the day, and things will turn out OK after all.

But to be cynical about this mission would be a kind of a failure too. The rescue is a true inspiration: a powerful reminder of what can be done when humans overcome their fears, pull together and put others first. In short, when they care. Twelve children were swallowed by the darkness last month. When they re-emerged into the light, they brought the rest of us with them.