It was dark and sopping wet at the Ningxia Night Market in Taipei, Taiwan. Yet even as the rain continued to seep into my socks, the narrow alleys were still jam-packed with people, elbow to elbow.

All we do is eat

They were jostling to place their order at Li Zhang Bo, a small stinky tofu stall run by Yiwen Wang and Qirong Li, Taiwan’s self-described queen and king of stink. Their signature dish – deep-fried fermented tofu on a bed of pickled vegetables – would make even the most pungent locker room smell like roses. But still, the line of loyal customers threaded around the block, stretching as far as the nose-wrinkling odour wafted into the world beyond. The secret to their success? Here, in Taiwan, it is “socially acceptable” to go hunting for stinky tofu in the middle of the night, said Wang.

Welcome to a foodie’s final resting place.

You may also be interested in:

• Japan’s unique take on a packed lunch

• The colourful tradition saving Bangkok’s street food

• A world outraged over crispy chicken

While most countries only have three meals a day, Taiwan worships food so much that there's a fourth and final meal: the midnight snack, or xiaoye in Chinese. That means while most of the world is winding down after dinner and getting ready for bed, the wakeful people of Taiwan are gearing up for their late-night ritual – which is, bluntly put, to hit the open streets and nosh until their jeans are ripping at the seams. “All we do is eat,” Wang said.

Taiwan treats ‘snack time’ seriously. No need to hit the clubs; rather, Taiwan’s loud, messy nightlife heaves and breathes inside overflowing night markets; beer houses sizzling with stir-fried foods; and all-you-can-eat karaoke lounges. Taiwan’s family-run midnight snack stands don’t feature endless menus, though. Instead, they focus on mastering one signature item and serve that dish over and over again – ensuring ‘perfection’ every time, according to Li.

The flavours of good food come from the cook's heartfelt persistence

“Behind every night market snack is also the diligence of the cook and the preservation of continued traditions passed on from each generation. It can be said that the flavours of good food come from the cook's heartfelt persistence,” Li said, himself a third-generation midnight snack-stand owner.

Imagine freshly pressed sugarcane nectar, sizzling oyster pancakes, blow-torched steak, honey-sweet pearl milk tea and comically fat pork sausages – all cooked in the open and right in front of drooling customers for their viewing pleasure. With the nation’s historical and colonial Dutch, Spanish, Japanese and Chinese culinary influences, the sheer variety of late-night grub one can find in Taiwan is enough to hopscotch across continents. Not to mention, millions of post-Chinese civil war immigrants brought regional dishes from nearly every province in China in 1949.

Taiwan is perennially full of middle-of-the-night snacks to munch on, long after the sun has slipped beneath the horizon and well into the ungodly hours of the morning. So, if New York is the city that never sleeps, then Taiwan must be the island that never gets full.

There are a few factors that compel the country’s hungry night owls to prowl the streets for food, said National Taiwan Normal University associate professor Yu-Jen Chen, who has the enviable job of researching the culture and history of cuisine in Taiwan. She explained that the word ‘xiaoye’ first appeared during the Tang Dynasty in the 9th Century to poetically describe the act of drinking wine to ‘kill’ the night, But the expression has taken on a whole new life and meaning since then. As the 1950s rolled in, Taiwan’s xiaoye scene evolved into a booming underground economy where merchants would informally get together and sell their wares and late-night food. “People took advantage of this thriving night-time economy to make more money and improve their lot in life,” Chen said.

Nowadays, the business of midnight snacking has turned into a more formal affair and an ingrained part of Taiwan’s mainstream culture. From the mass of 24-hour convenience stores to the constant clamour of scooters at all hours of the night, Taiwan is a sleepless society that’s been gradually shifting towards later hours over the years. According to Taiwan’s Ministry of Labor, people work long hours that rival Japan’s and Korea’s record-long working days, averaging just under 170 hours per month in Taiwan, and young students often study well past 20:00 in cram schools (after-school tutoring centres).

For outsiders though, the restless and breathless culture of xiaoye is an off-script introduction to Taiwan's culinary scene, according to Chen. “If I were to describe Taiwan’s night markets, I would say renao,” she said.

Renao, the untranslatable ‘hot and noisy’ aspect of life in Taiwan that is cherished by many, is a strongly rooted social phenomenon that resonates deep within Taiwan’s tight-knit community, according to a 2008 study from the Asia Pacific Journal of Marketing and Logistics. The idea behind renao, which is used to describe a lively place that’s fizzling with excitement, is a holy grail of strong smells, bright lights and an endorphin-fuelled sense of social belonging that surges with big crowds. The idea is not unlike the feeling of lining up for the latest iPhone on Black Friday in the US. That same heightened collective sense of renao is what people feel when they take part in Taiwan’s traditional communal values, such as family or religion, according to the study.

That’s why most, if not all, night markets and late-night eats in Taiwan are centred around temples, Chen explained. After worship, people will often gather and eat their hearts out as a community. It's why even the smallest villages of Taiwan have bustling night markets. Plus, renao has long been expressed in ancient Chinese history to positively convey full-of-life activities like parties, festivals and large gatherings, where the crowd is so thick that there isn’t even a breeze to feel.

“People go out not just because of the food, but because the food also creates a lively, one-of-a-kind atmosphere,” said Leslie Liu, a popular Taipei food blogger.

Back at Li Zhang Bo, stinky tofu stall owner Li was like a walking exclamation mark. It was 23:00 but he showed no sign of slowing down. Neither did the line of people streaming out the door. Li was chatting the ears off waiting customers who have graced his tables over the decades. “It’s amazing,” said first-time customer Bu-Luo Hsin as she nibbled on the crispy, craggy, deep-fried tofu skin, describing it as melt-in-your-mouth “tender” on the inside and “crunchy and savoury” on the outside.

In Taiwan, there is no such thing as a full belly

The Li Zhang Bo stall is one of storied stinky tofu fame, with the restaurant owned and managed by the same family for three generations. It’s also what Hsin affectionately described to me as a ‘fly restaurant’ – the outside is bare bones, but what the eatery lacks in décor it makes up for in flavour that’s so irresistible that patrons buzz in like flies every evening.

Nightfall is no limiting factor here. After all, in Taiwan, there is no such thing as a full belly.

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 Future, Earth, Culture, Capital and Travel, delivered to your inbox every Friday.