The factory was smaller than I expected; you wouldn’t have any idea that the two-storey, red brick building turns out 600,000 cakes a week. The only sign it made sweets at all was the phrase ‘Lancashire Eccles Cakes’ piped in cheerful yellow, like icing, across the front.

But as soon as I walked inside, the smell hit me: a heady sweetness that reminded me a little bit of mulled wine. I was in the right place.

More of a round, flat pastry than a traditional cake, with a currant filling sandwiched between flaky, buttery layers, the Eccles cake is a British institution. (It is no surprise that it goes extremely well with a cup of tea). Like many of England’s other delicacies, it has a history as rich and as local as the pastry itself.

But where many of Britain’s other centuries-old recipes have almost completely disappeared, the Eccles cake has hung on. In recent years, it even received renewed notoriety: the pastry made headlines when the Lancashire Fire and Rescue Service reported at least three blazes in three weeks, thanks to people warming up Eccles cakes in their microwaves. (The theory is that the sugar – which often is sprinkled on top of the cakes – caramelises and gets set alight).

Fire-setting aside, if the cakes have remained on the English culinary landscape, it’s largely due to this factory on the edge of Manchester, five miles down the road from the cake’s birthplace of Eccles. Owned by the Edmonds family, who have been making the pastries for some 75 years, Real Lancashire Eccles Cakes is the world’s largest producer of Eccles cakes.

Inside, over a plate of Eccles cakes still warm from the bakery’s ovens, production director Ian Edmonds told me the secret of why the pastries were so delicious – and why other, larger corporations have a hard time competing.

“They’re mass-produced, but they’re handmade,” he said. “Companies will try to do it all by machine. But to make it by machine, you have to put less-rich ingredients in, you’ve got to make the pastry a bit tougher, you’ve got to dump all the butter. The quality isn’t there.”

In the factory, I saw what Edmonds meant. There were machines, of course, but even they were handcrafted: nearly all of them are bespoke designs that Edmonds created with the help of an engineer. But every step of the process still requires a close eye and careful hand.

See how an Eccles cake is made:

First, huge boxes of currants from Vostizza, Greece, already hand-selected and dried, were unpacked and poured into a machine to be washed and crushed. Meanwhile, other workers carted enormous blocks of butter to dump into a 30-gallon mixer. As well as expensive, butter is difficult to work with. As a result, many pastry factories often use plasticised fats instead, which remain hard and have a higher melting point.

“But the problem is when you eat the pastry, especially something like a puff pastry, you can feel it on the roof of your mouth,” Edmonds said. “Butter melts in your mouth. But [plasticised fats] melt at a higher temperature, so then it doesn’t melt in your mouth. ‘Palate cling’, it’s called.”

The dough, which uses flour from a family-owned mill in the neighbouring town of Stockport, is then fed through the assembly line, where it is flattened, cut, piped with the sweetened currant filling and hand-folded by workers with fingers so nimble they could double as professional pianists outside of factory hours.

If the challenges of large-scale production has meant that Eccles cakes don’t have the international numbers (and recognition) of, say, sponge cake or hot cross buns, it also means that they’ve retained some sense of handmade heritage – and allure.

In the last few years, renowned British chefs Heston Blumenthal and Fergus Henderson have put their own spins on the recipe; MasterChef Australia competitor Lucy Wallrock won a challenge with her version; and the pastry has become a must-eat at top London restaurants like Duck & Waffle.

But the most notorious headlines were in 2013, when the cakes were setting microwaves alight. Today, the cakes even come with a warning on the packaging: ‘DO NOT MICROWAVE’.

When I asked Edmonds about the rumours, I didn’t even have to finish my sentence before he broke in. “Oh yeah, explosions! We heard that,” he said. “But one of our staff says she microwaves them and they’re fine. So I don’t know.”

You’ve never done it yourself?, I asked.

“No, no, no,” he replied firmly.

But it’s not because he’s afraid for his life; it’s because microwaving makes the cakes soggy. Instead, Edmonds recommends warming them in the oven. That – not the fires – was the reason for the warning label.

Still, it isn’t the first time the cakes have been associated with some surprising risks.

Like many of Britain’s cakes, the pastry has its origins in religious festivals. As one Mrs CF Leyel wrote in her 1936 book Cakes of England, “There was no festival or sacrament of the Church that was not symbolised by a spiced bread or cake.” (Or as Shakespeare put it: “Dost thou think, because thou art virtuous, there shall be no more cakes and ale”?). It’s thought that the Eccles cake was made for the feast day of St Mary in Eccles, whose town festival, known as Eccles Wakes, included the custom of rush-bearing (spreading rushes over the church floor), music and dancing.

During the strict Puritan years of the 1600s, that connection between Eccles cakes and religious revelry got the cake into trouble. Although legend has it that Oliver Cromwell himself banned the cakes, the truth is a little more nuanced. Puritan reformers abolished the celebration of saints’ days, and then, in 1650, banned doing much of anything, including dancing, on the Lord’s day of Sunday.

Because of their close connection with the celebration of a saint’s day (and that some of these festivities fell on Sunday), as well as with general merriment on the town green, any cakes would have been de facto banned. But as is always the case with legal pronouncements versus how people actually live day-to-day – particularly with laws as persnickety as those of the Puritan era – people didn’t always pay attention. “Eccles had a particularly stern Puritan parson but oddly enough Eccles cakes continued to be baked,” writes Joan Poulson in the book Old Lancashire Recipes. “They were later sold at many of the fairs and wakes in Lancashire.”

Though the ban on festivals later was lifted, by the 1800s, as this painting from 1822 shows, the Eccles Wakes were getting rather boisterous. Games like cock fighting and bear baiting had become part of the festivities. Fed up, the Home Secretary banned the Wakes in 1877.

The cakes still didn’t go away. The first Eccles cake bakery had opened in 1796 – appropriately in a shop across from St Mary’s Church. In 1810, the owner opened a new bakery across the road. Eccles became so well known that even as early as 1838 a guide to railroad journeys through Britain noted simply, “This place is famous for its cakes”.

Today, the first two Eccles bakeries are long gone. So is the thatched-roof store called The Old Thatche, which in the late 19th Century advertised that it sold ‘pure ice cream’, ‘herb beer’ and ‘Original Eccles Cakes’; it was demolished in 1915 to build a bank. Even the Eccles outpost of the bakery chain Greggs doesn’t sell the cakes.

Now, the only bakery in the area focusing on Eccles cakes is the Edmonds’ factory. Its claim to the cakes is also historical. In the 1920s, Edmonds’ grandfather began running a cake-delivery service for local bakeries – first with a horse-drawn cart, then a model-T Ford. The family began to make cakes themselves in the 1940s; the current company has been here since 1979.

Even so, it may be no surprise that, with a delicacy that has as much local pride and history as the Eccles cake, some take umbrage to the factory’s location. Some critics have said they can’t call themselves Eccles cakes without being in Eccles.

To that, Edmonds has one answer: “If you think we’ve got problems, have a word with Mars Bar.”

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

This story is a part of BBC Britain – a series focused on exploring this extraordinary island, one story at a time. See every BBC Britain story by heading to the Britain homepage; you can also follow us on Facebook and Twitter.