It was mid-afternoon on our second day living in Hawaii, and I woke up groggy from a much-needed power nap. I stumbled into the kitchen where my girlfriend was sitting on the floor with the guy from the cable company. He had come to set up our internet – something we direly needed, because our house is situated in a lush valley with no mobile phone signal. But, I realised, they weren’t even talking about the internet. Instead, I found, he was inviting her to come boar hunting with him.

You may also be interested in:

• The code that travellers need to learn

• The Swedish word poached by the world

• The Greek word that can’t be translated

As the days passed, the friendly happenings increased. We stopped by a neighbourhood farm and were offered avocados from the caretaker’s tree. We arrived at the end of a hiking trail, or so we thought, when a passing father and daughter offered to show us the secret additional part of the path that led up a rock face, over boulders and through a stream to a hidden waterfall. On another occasion, we were headed for a swim in the ocean, when someone on shore warned us that the current was too strong to swim safely, then offered us a beer and invited us to go canoeing.

There may be many words to explain these kinds of encounters, but at least one of them is ‘Aloha’. And as it turns out, ‘Aloha’ is actually the law here.

Hawaii now hosts almost nine million visitors a year, and ‘Aloha’ is a word that most of those tourists will hear during their time on the islands. The word is used in place of hello and goodbye, but it means much more than that. It’s also a shorthand for the spirit of the islands – the people and the land – and what makes this place so unique.

“Alo means ‘face to face’ and Ha means ‘breath of life’,” according to Davianna Pōmaikaʻi McGregor, a Hawaii historian and founding member of the Department of Ethnic Studies at the University of Hawaii, Manoa. But McGregor also noted that there are several less literal, but equally valid, interpretations of the word.

Aloha is a concept that grew out of the necessity for Hawaiians to live in peace and work together

One especially memorialised interpretation was shared by a respected Maui elder named Pilahi Paki at the 1970 conference, Hawaii 2000, where people had gathered to discuss the past, present and future of Hawaii. It was a time of heightened disagreement in the islands, over Vietnam and other political issues, and Paki stood up to give an emotional speech about the Aloha Spirit – in other words, the unique spiritual and cultural code of a Hawaii that is uniting rather than divisive. In it, she described what Aloha meant about the way people should treat one another.

In her speech, she broke each letter of ‘Aloha’ down to one phrase. And that speech became the basis for Hawaii’s Aloha Spirit law, which essentially mandates consideration and kindness:

“Akahai, meaning kindness to be expressed with tenderness;

Lōkahi, meaning unity, to be expressed with harmony;

ʻOluʻolu, meaning agreeable, to be expressed with pleasantness;

Haʻahaʻa, meaning humility, to be expressed with modesty;

Ahonui, meaning patience, to be expressed with perseverance.”

Although the Aloha Spirit law didn’t become official until 1986, its origins are deeply rooted in native Hawaiian culture. Aloha is a concept that grew out of the necessity for Hawaiians to live in peace and work together, in harmony with the land and their spiritual beliefs, McGregor told me.

It makes sense. Hawaii is the most isolated population centre in the world: the California coast is around 2,400 miles away; Japan is more than 4,000 miles. The islands are small – most (like Maui, where I live) can be driven around in a single day. Then, as now, there are no bridges connecting the islands, and even inter-island travel is a challenge. With nowhere to go, the only option, it would seem, is to get along.

“Being isolated, historically, our ancestors needed to treat each other and the land, which has limited resources, with respect,” McGregor said. “For Hawaiians, the main source of labour was human. So there was a need for collective work among extended families and a high value placed on having loving and respectful relationships.”

Like any place, she added, Hawaii had its problems with people abusing power. But, she said, there’s evidence that if a chief was not acting ‘‘with Aloha”, peace-loving Hawaiians would find ways to get rid of them.

It’s not so different from how the Aloha Spirit law is applied today.

According to the Hawaii State Attorney’s Office, the law is mostly symbolic, but that doesn’t mean it doesn’t work – especially when political leaders or business people get out of line.

“This law is virtually impossible to enforce because it is a philosophy that directs a code of conduct and way of life. Nonetheless… all citizens and government officials of Hawaii are obligated to conduct themselves in accordance with this law,” Dana Viola, first deputy attorney general of Hawaii, said in an email.

If a business or a government official doesn’t act with Aloha Spirit, they could lose business or be chastised publicly. “So the consequences are real,” she added.

But Wendell Kekailoa Perry, assistant professor at the Hawai'inuiakea School of Hawaiian knowledge, who has studied the Aloha Spirit law in depth, said that the law and its sentiment aren’t always positive.

“The Aloha Spirit is used to argue that everyone in Hawaii can ‘feel’ and should accept the love for humanity… [and] says that the Aloha Spirit transcends race, differences and embraces togetherness or ‘equality’. That is a problem because it ignores all of the complexities of our life and society,” Perry said.

“Maybe, on a good day, the law can support Hawaiian rights,” he added. But on a bad day, he said, it can be used to silence native Hawaiians who are protesting injustices in the islands. When that happens, “The Aloha they are using is actually part of the ‘passive’ and ‘don’t-make-waves’ native identity created during the US occupation and control. But, if you look at the thousands of debates that were publicly expressed in Hawaiian language newspapers and protests, it is obvious that passivity was not the only Hawaiian cultural practice.”

Before Paki, who inspired the law, passed away, she reportedly said that with Aloha, and the mutual respect that it entails, “Hawaiians have the power to save world culture.” Although the law likely has its flaws, it’s something that still resonates in the islands.

"Visitors to Hawaii often talk about how Hawaii is a beautiful place, but the most special part of their experience has been the people, and how nice people are,” said Hawaii State Representative Tulsi Gabbard. “People across the United States and around the world ultimately want peace... By truly living Aloha – having respect and love for others – we can be empowered to overcome those differences and find solutions that best serve the wellbeing of people and our planet."

Aloha, for me, is kindness and harmony – something important to keep in mind between ‘hello’ and ‘goodbye’

Often, when people think of Hawaii, it’s in the context of a holiday. When I moved here two months ago, a friend said “Think of me when you’re having cocktails on the beach.” He imagined an idyllic, one-dimensional version of my life that doesn’t square with the reality. There’s still work to do, bills to pay, shopping and laundry to do and all the other trappings of a normal life.

The Aloha Spirit law is somewhat similar. It’s an idealised version of something that does exist, but is far too complicated to fit in a one-page definition.

For now, I’ll say that Aloha, for me, is kindness and harmony – something important to keep in mind between ‘hello’ and ‘goodbye’.

Why We Are What We Are is a BBC Travel series examining the characteristics of a country and investigating whether they are true.

Join more than 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 bbc.com features newsletter called "If You Only Read 6 Things This Week". A handpicked selection of stories from BBC Travel, Capital, Culture, Earth and Future, delivered to your inbox every Friday.