Several years back, I visited Iceland in the dead of winter. I was researching a book on global happiness, and the small Nordic nation intrigued me. What was this country, adrift in the freezing North Atlantic, doing perched atop the world’s happiness rankings?

In pursuit of answers, I buttonholed anyone willing to talk, dined on harkl (rotten shark), drank excessively, and, of course, took a dip in the Blue Lagoon, the otherworldly geothermal waters that have become synonymous with Icelandic bliss.

Shortly after I left, Iceland’s largest banks went belly up and the nation’s economy teetered on the verge of collapse, collateral damage from the global financial meltdown of 2008. The unemployment rate spiked eightfold. Trust in institutions, like the banks and parliament, plummeted.

I assumed that the nation’s happiness also nosedived.

I was wrong.

“The economic crisis had a limited effect on happiness,” according to health scientist Dora Gudmundsdottir, author of an exhaustive study published in the Social Indicators Researchjournal. Not only did the nation’s overall happiness dip only slightly during the crisis, but 25% of Icelanders reported greater happiness. What was going on?

I emailed Karl Blöndal, a newspaper editor I had met in Reykjavik. “A lot of individuals have been hit hard, pensioners lost their savings. But one thing about living in a small community is that everyone you know is within reach,” he explained. “Those who lose their jobs are not isolated, the risk of estrangement is not the same as it would be in bigger societies.”

Here was an essential truth about Icelandic happiness: it is largely a collective enterprise.

Iceland, even with its cosmopolitan capital of Reykjavik, resembles a small town in many ways. People needn’t worry about falling into a black hole, Icelanders say, because there is no black hole to fall into you. There’s always someone to catch you. As one American immigrant to Iceland told me, if your car is stuck in the snow, someone will always, always stop. In fact, trust levels are so high that it’s not unusual to see six-year-olds walking to school alone in the winter darkness.

In a typically optimistic Icelandic statement, Blöndal even managed to see the opportunity embedded in the financial crisis. “Now we can wipe the slate clean. Who knows – this might just as well be an opportunity to forge a better, more open society where power is more diffused and the old vested interests and economic blocks have been cleared out of the way.”

This idea of an open, fair society seems to be key.

According to a recent United Nations report on world happiness, happiness is evenly distributed in Iceland. That is, most Icelanders are more or less equally happy, while in other nations – particularly those in the Middle East and Latin America – happiness levels vary tremendously. This is important because “new research suggests that people are significantly happier living in societies where there is less inequality of happiness.” In other words, we can achieve only so much happiness if our neighbours are miserable. Icelanders seem to intuitively recognise this essential truth.

Icelanders have also developed a fierce resilience honed over centuries of deprivation and isolation. Think winter darkness, volcanic eruptions and unforgiving terrain so otherworldly that NASA dispatched the Apollo astronauts here in 1965 to train for their upcoming moon walks.

You see this sort of stubborn optimism at work every day in Iceland. You see it in the way people swim outdoors, year round, or how there is no stigma attached to abandoning a bad job or relationship. This resilience can also be found in the country’s rich literary culture, one that dates back to the old sagas – Viking tales of heroism in the face of adversity.

Today, Iceland publishes more books per capita than any country in the world. Some psychologists believe that literature – and other cultural resources – provides a buffer during difficult times. Stories provide a vehicle for expressing grief, and grief expressed is grief reduced. They also provide a means for a culture to channel its creative energies.

And Icelanders certainly recognise the value of the written word, an attitude reflected in a common Icelandic saying: “Better to go barefoot than without books.”

A happy thought, if ever there were one.

If you liked this story, sign up for the weekly bbc.com features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories from BBC Future, Earth, Culture, Capital, Travel and Autos, delivered to your inbox every Friday.