Abu al Saoud’s sweets shop smells like the Gaza that could have been. Inside the large glass doors, shiny displays and clean tables are enveloped by the warm waft of sugar and dough. It’s quiet except for the chatter of customers and the ‘clink clink’ sound of the server slicing up the shop’s famed sweets and storied attraction: Knafa Arabiya.

This Gaza Strip version of knafa, a beloved Middle Eastern sugar-soaked pastry, is rarely found outside of the tiny coastal enclave. The more widely known kind is Knafa Nablusiya (from Nablus in the Palestinian territories), where cheese – common in Palestinian desserts – is layered between crushed noodles or semolina. Knafa Arabiya or Ghazawiya (Arabic or Gazan) is a savoury-sweet twist, made richer with the signature Gaza flavours of nuts, nutmeg and cinnamon replacing the cheese.

You may also be interested in:

– The cake that comes with a warning

– The deadly dish people love to eat

– The ancient path through Palestine

Saqallah’s Sweets, as Abu al Saoud’s is also known, has been baking Gaza’s most characteristic dessert since 1896. The dish’s exact origins, however, are hard to pin down. Mahmoud Saqallah, grandson of the store’s patriarch, proudly offered one theory, dating it back to the 7th Century and the time of the Prophet Mohammed, when his companion, Ali ibn Abi Talib, reportedly requested a hearty dessert – and behold, as Saqallah told it, Kunafa Arabiya was born. True or not, the story speaks of the dish’s storied place in Palestinian Gazan identity.

Today you need a hard-to-procure permit to enter or exit Gaza. But historically, this now isolated area was a place of crossroads and commerce. In ancient times, Gaza was the main port along the Mediterranean and access point for travellers and traders on route to the Levant and greater Syria, Arabian Peninsula or Africa. Today, its cuisine of unique combinations still mirrors this past.

“[Knafa Arabiya] reflects Gaza itself,” said Laila El-Haddad, author of The Gaza Kitchen. “It’s a more rustic dessert that’s richly spiced.”

She added, “In modern times, as it’s [Gaza] become more closed off, these flavours have become relatively unknown, even to other Palestinians.”

Knafa Arabiya reflects Gaza itself

In fact, today most people physically can’t access the dessert. After decades of rule by the Turks, Brits and Egyptians, Israel then occupied Gaza from 1967 to 2005; two years later Hamas, a designated terror group, violently seized power from its rival, the more moderate Palestinian Authority (PA) based in the West Bank. Israel and Egypt then imposed travel and trade blockades on Gaza. Over the last nine years, Israel and Hamas have fought three devastating wars; many in Gaza have still not recovered from the last one three years ago.

Today, Israel restricts most border crossings. At the Erez crossing in southern Israel, the only point of entry and exit for people between Gaza, Israel and the Palestinian West Bank, "Food is not permitted to be exported from Gaza for regulatory purposes," according to Israel’s Coordination of Government Activities in the Territories. Informally, however, half a kilo or a kilo of sweets – or about two big plates of Knafa Arabiya – will get through.

When I visited Abu al Saoud’s shop in July, times were tough and getting tougher. Gaza was a month deep into a severe electricity crisis that left the strip's two million people with just two to three hours of power a day – down from only eight hours in the months before. The lucky ones, like Abu al Saoud, can keep lights on longer with generators. Even at just five shekels per slice – the same price as in Nablus – the knafe is unaffordable for many in Gaza, which has some of the highest unemployment in the world.

Despite the hardships, Abu al Saoud has had several successful locations around Gaza City. In 1994, a time when now-stalled negotiations over creating a Palestinian state appeared most promising, Saqallah Sweets added Knafa Nablusiya to its mix. The family opened the current location in central Gaza City in 2009, just a few weeks before a war with Israel. By the war’s end, bombs had shattered their windows and cost them tens of thousands of pounds in losses and damages.

Now, with borders blocked and money getting tighter, “It’s hard to create a consistent system,” Saqallah said, explaining that high-quality ingredients – and even just some of the basics – are becoming harder and harder to procure.

Though, according to Saqallah, “It’s not just about the materials, but how it’s cooked.”

In the kitchen below the bustling shop, Saqallah’s team has mastered the art. Saqallah declined to give his exact Knafa Arabiya recipe, but described how it starts with a base of toasted and ground semolina, whey and milk that’s cooked and refined to achieve the dish’s characteristic coarseness. Next, the crumbly dough is poured over a large oiled pan, followed by a mix of cinnamon, sugar and nutmeg and a layer of ein jamal – the eye of the camel, or walnuts. Then it’s all pressed down by a smaller pan and placed over a large fire stovetop for about 20 minutes. The final touch, of course, is a layer of syrupy sugar poured on top.

The dish is best served hot – but if it’s covered for too long, it will go dry and clumpy, the tell-tale sign of lesser-quality knafa, Saqallah warned.

The complicated texture is tough to achieve at home, which is in part why the dish has remained largely unknown outside of Gaza, said El-Haddad. Instead, home recipes, like the one in her cookbook, rely on an easier mix of bulgur and semolina to achieve the knafa’s pastry base.

Saqallah has been working at the shop for 40 years. Now one of his six children, Saud, 31, is being prepped to inherit it. On any given day and night, the store is packed, especially during holidays or the beginning of the month, when salaries come.

"We always come here for it," said 20-year-old Nur, who a little before 10am was waiting with four university friends for the first knafa of the day to be ready. They had an appointment that morning nearby and decided to treat themselves first; three wanted the more savoury Arabiya and two opted for the cheese version.

They were a bit taken aback by my intense interest in the dish. “It’s not weird to us at all,” Nur said with a smile.

Culinary Roots is a series from BBC Travel connecting to the rare and local foods woven into a place’s heritage.

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 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.