In a quiet corner of northern Europe there exists a geopolitical anomaly, where many buildings have an international border running right through them. It’s a place where a person might be in the same bed as his or her spouse, but sleep in different countries. A place where people move their front doors for economic advantage.

They look like cartographic amoebae

Not far from the Belgian border, the Netherlands municipality of Baarle-Nassau is home to nearly 30 Belgian enclaves, known collectively as Baarle-Hertog. On the map, they look like cartographic amoebae, some of them with Dutch nuclei inside.

You may also be interested in:

• The strange US-Canada border dispute

• The village divided by a border

• The library straddling two nations

This whole confused mess dates to the Middle Ages when parcels of land were divvied up between different local aristocratic families. Baarle-Hertog once belonged to the Duke (hertog is the Dutch word for ‘duke’) of Brabant, while Baarle-Nassau was the property of the medieval House of Nassau. When Belgium declared independence from the Netherlands in 1831, the two nations were left with an international muddle so complicated that successive regimes were deterred from defining exact jurisdictions. The borders were not actually finalised until 1995, when the last remaining piece of no man’s land was attributed to Belgium.

On first impression, it’s not easy to tell the territories apart, as they look no different from any typical red-brick small Dutch town. Around three-quarters of the region’s roughly 9,000 total residents are Dutch passport holders, and the Dutch municipality also has by far the larger share of land (76 sq km compared to 7.5 sq km). But after a while the differences become apparent, albeit with the help of pavement markings – white crosses with ‘NL’ on one side and ‘B’ on the other – and house numbers which are marked with the appropriate flag.

The Dutch properties are more uniform in appearance than their Belgian counterparts, and Dutch pavements are lined with lime trees, their limbs carefully pruned and braided like vines. The Belgian areas tend to be more architecturally diverse.

If I had an ear for it, I’d be able to differentiate accents, too, explained Willem van Gool, chairman of the Baarle tourist office (himself a Dutch passport holder, though his mother is Belgian). Although French is taught in the Belgian schools, Dutch is the primary language of both communities.

However, van Gool noted, “With the Belgians it is more like a dialect, and with the Dutch it is more… clean.”

That, and the less prescriptive approach to residential landscaping on the Belgian side, has led to a tendency on the part of some of the Dutch to look down on their neighbours. “Back in the days when the schools emptied out at the same time, teenagers would fight,” recalled van Gool, but that all stopped in the 1960s when the town’s two mayors (one Dutch and one Belgian) altered the school timings so that they didn’t overlap and combined the youth club to promote positive interactions.

Today, many residents of Baarle-Nassau and Baarle-Hertog have dual citizenship and both a Belgian and a Dutch passport. The peaceful interweaving of the two nations has attracted the interest of advisors to Israeli prime minister Benjamin Netanyahu, as an example of how two different communities can live harmoniously together.

So is all this border obscurity to Baarle-Nassau and Baarle-Hertog’s benefit? It certainly attracts tourists, said van Gool. “The number of shops, hotels and cafes we have would be more suited to a town of 40,000 rather than 9,000. And when the Belgian shops have to close on Sunday, the Dutch don’t.”

The complexities can still prove difficult, however, especially when it comes to infrastructure. Building permits can be particularly tricky, said Leo van Tilburg, mayor of the Belgian municipality, whose town hall is bisected by the border. Because of its location, Belgium had to seek Dutch permission to build part of their mayoral building – the part delineated by the brightly illuminated border strip running right through the meeting room.

Everything is a matter of negotiation

Much of Tilburg’s time is devoted to sorting out the delivery of services – education, water, infrastructure – in co-operation with his Dutch counterpart, Marjon de Hoon. Resurfacing the roads is his particular bugbear, as roads can cross borders several times within a few hundred metres. And then there are issues like the planning of sewage pipes.

“The road under which the pipe is being installed may be all Belgian, but who pays if the pipework has to be enlarged thanks to Dutch houses nearby? And who pays to service the streetlights, where the pavement is Belgian but the light shines on Dutch windows?” Tilburg said. “[But] if there are 100 problems, 98 of them will turn out to be no problem – after plenty of discussions, of course.”

Everything is a matter of negotiation.

Given that Belgium’s planning laws are less restrictive than the Netherlands’, there are clear advantages to having a front door in Belgium, as Kees de Hoon (no relation to the Dutch mayor) explained when I met him at his border-straddling apartment block. A Dutch passport-holder living in Baarle-Hertog, Kees wanted to redevelop the original building, but the front door was in the Netherlands and he couldn’t get planning permission from the Dutch town hall. He solved the problem by simply installing a second front door, adjacent to the first but on the other side of the border. So now with two front doors to the building, one of his apartments is Dutch, and the other three are Belgian.

It was done on both sides of the border

Kees isn’t the only one who has taken advantage of jurisdictional loopholes; many long-established families and business owners will admit to have benefited in some small way. The most flagrant example is a former bank that was built right on top of the border so paperwork could be moved from one side of the building to the other whenever one nationality’s tax inspectors came calling.

Although loophole-exploiting isn’t as common as it once was, I couldn’t help imagining the glory days of cross-border rule-bending. The cattle that mysteriously changed fields overnight. The shop stock that was acquired in one country and sold in the other without bothering the tax man. “It is a subject the locals like to talk about,” agreed van Gool, “and it was done on both sides of the border.”

That doesn’t mean the two jurisdictions are without friction. The drinking age in the Netherlands is 18 but Belgians can legally drink beer and wine at 16, so if a Dutch barkeeper refuses to serve a crowd of teenagers, they can just thumb their nose at him and walk across the road. And the many fireworks shops in the Belgian parts of town are a source of irritation to the Dutch authorities. In the Netherlands, the sale and carriage of fireworks is illegal (except for around the New Year). So when I came to the end of my November visit in Baarle-Nassau/Baarle-Hertog, I had to face Dutch police who were scrutinising everyone leaving town.

It seems that, in this laboratory of trans-frontier co-operation, there are still a few outstanding issues to be resolved.

Places That Don’t Belong is a BBC Travel series that delves into the playful side of geography, taking you through the history and identity of geo-political anomalies and places along the way.

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.