Colombians live for the celebration. The South American country has more festivals than days of the year, and whether it’s the multiday revelry of Carnival in Barranquilla, the great kaleidoscopic displays of floral colours during Medellín’s Feria de las Flores or Caribbean coastal residents dressing their donkeys in drag and parading them down the streets during the Festival de Burro, there’s always a party to be had.

This is just one of many reasons an annual WIN/Gallup International poll ranks Colombia as  one of the happiest countries (and occasionally the happiest country) in the world.

The rumba continues despite Colombia’s sordid past. Most outsiders know the South American nation as a country steeped in violence, with 50 years of civil war; as a place where kidnappings by left-wing guerrillas and right-wing paramilitaries were commonplace; and as the land of cocaine and narcos.

But this is no longer Pablo Escobar’s Colombia. And on the eve of a shaky potential peace deal between the government and the country’s largest guerrilla group, the FARC, it seems appropriate to understand how residents have maintained their renowned happiness in the face of unimaginable atrocity, loss and economic hardship.

Ask 100 Colombians about happiness and you’ll likely get 100 variations on a similar theme. “Money is nice but it’s not the most important thing,” “In general we are a culture that values what you have,” and “We love people and music” were just some of the responses I got.

You see evidence of this value system every day. It’s in the welcoming spirit Colombians show to the rapidly increasing numbers of foreign tourists. And this goodwill extends to people in their own country as well.

Colombia’s population is 90% Catholic. The largest immigrant group is Middle Eastern Arabs – between 40,000 and 50,000 arrived here between 1880 and 1930, and today there are Arab communities throughout the country (one of South America’s largest mosques is located in Maicao, in Colombia’s Guajira Department). Despite this, there is very little religious tension. International terrorism has yet to reach this country, and crime statistics make no mention of anti-Muslim hate crimes here.  

Maher Nofal is the second-generation Palestinian-Colombian owner of Shawarma Khalifa, an Arabian restaurant in central Bogotá. Inside, hijab-wearing Islamist converts work side by side with turban-wearing black Colombian women, often migrants from the impoverished Chocó region of the Pacific Coast. Thinking of the recent shootings of Indians mistaken for Iranians in the United States, I asked Nofal if customers ever cast a suspicious eye on his employees.

“No,” he replied. “Colombians are innocent. They’re curious. They ask the employees about the things they see on TV saying that Muslims are all terrorists. The employees explain that the minority doesn’t represent their religion, which is one of art and acceptance and love. And Colombians accept that answer.”

Of course Colombia has had its share of homegrown violence and terror; no other country in South America has endured such a sustained period of conflict. But this is something that Oscar Gilede, a biologist who leads nature treks via his Colombian Highlands tour company, believes is integral to their notion of happiness.

“I think that that Colombians generally feel happy, and the perception of happiness is subjective. I mean, it’s clear that a country that has lived with war for the last 50 years should see very low rates of happiness,” he said.

Like many Colombians, war has come close to Gilede’s doorstep. His brother was a military guard in Bogotá’s Plaza Bolívar in 1985, when M19 guerrillas stormed the Palacio de Justicia and murdered 12 Supreme Court Justices. “But,” he continued, “that same reason for endless war means Colombians have become indifferent to situations of war. In other words, if the problem does not touch me directly, I must feel grateful, satisfied, optimistic, lucky.”

Although Colombians have yet to achieve peace and stability, they continue to strive for it with unshakable resolve

Rodrigo Martínez, a historian at the University of Antioquia, agrees, explaining that although Colombians have yet to achieve peace and stability, they continue to strive for it with unshakable resolve. “Colombians have always demonstrated incredible, Herculean and powerful resilience to war, death and to the harsh history of violence and diplomatic failures,” he told me.

Gilede believes that Colombians feed this resilience through human connections and the communal experience.

“We live for parties, holidays, and fill the void with a fanaticism for sporting events and beauty pageants and entertainment and so on. And the moment one event ends we’re already thinking about the next.”

One activity Colombians never seem to stop thinking about is dance. Salsa is the country’s musical pulse, and nearly everyone dances it, especially in Cali. This pleasant but unassuming city in southern Colombia’s fertile Cauca Valley is Mecca for salsa dancing. The world championships are held here annually, and the city is home to the country’s most famous salsa clubs.

“The dance frees you. It is a way of expression and feeling. Here the music is carried in the blood, in the veins, in our heart. It’s a great passion we carry throughout our lives,” said Nhora Alejandra Tovar, a dance teacher and owner of Cali’s Arrebato Caleño salsa school.

Colombian salsa, as opposed to other forms, is denoted by faster syncopations that match the people’s natural energy. It’s an egalitarian genre, accessible to everyone, and it seems to make the entire country happy. But is it a different experience than in other countries, like, say, with Brazilians and samba?

“I think there are several differences,” Tovar said. “Our dance is much more sociable. It’s necessary to dance salsa as a couple or in a group. There is a more direct connection. For these reasons, it’s been gaining importance in the world.”

Here the music is carried in the blood, in the veins, in our heart. It’s a great passion we carry throughout our lives

I asked her about the dance’s importance at home, amid violence and conflict and economic hardship.

“Salsa is a refresher of human dignity. It overshadows inequity and discontent with sharp rhythms and the madness of love. It closes social distances because it requires people to embrace each other in a moment of eye contact, the feel of the skin, bringing them together with movement, helping them to know each other and see the best in each other. It has a long cultural heritage of peace,” she replied.

There is certainly joy and peace in the salsa clubs, but does it extend everywhere, to areas where people live in the most desperate conditions? Can there be peace even in the hardest of places?

To find out, I took a minibus up the corkscrew streets of east Medellín to Villa Hermosa, number eight of 16 comunas (communes) that make up the city ­– and one with a reputation for violence. In the late 1980s to early ‘90s, Medellín was the most violent city in the world. Today it’s enjoying the turnaround that comes with a diminished narco presence and the building of an efficient metro system connecting every corner of the city. Even Comuna 8 is on the rebound.

“We are very privileged God gave us this land,” said Carolina Ramirez, my guide for the day, as she surveyed the surrounding mountains. Like many in the comuna she carries the scars of years of violence. The physical ones she conceals with clothing; the emotional ones present as nervous smiles or mood swings. Her family has lived in Comuna 8 for 60 years. “Now there are parks and bicycle trails.” She pointed to the Uva La Libertad sports complex. “Today, hundreds of kids play soccer in there.”

There’s still crime here, and ‘invisible walls’ exist. Match the wrong description or rob someone and you could wind up dead. But there’s also life. Parents take their kids to school, men play pool and housewives gossip with neighbours.

“My generation are survivors,” Ramirez said. “They lived the consequences of the war: drugs and prostitution. There’s more opportunity for young people to study and work and construct a life now.”

She added, almost in offhand manner, “I’m happy for them.”

Ramirez can be seen as a symbol of her nation. Colombia is a country that has bled, yet through it all, its people never lost their innocence, their resilience. Their happiness is predicated on that unshakable spirit, that commitment to warmth and fellowship and charitable views of people.

To an outsider, it may seem naïve, but Colombians’ steadfast happiness has been their most effective weapon in the war against despair. It has seen them through civil wars and bombings and kidnappings, and has carried them to the cusp of the final victory, where dreams of the peaceful country they so richly deserve might finally become reality.

Join over three million BBC Travel fans by liking us on Facebook, or follow us on Twitter and Instagram.

If you liked this story, sign up for the weekly 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.