The UK’s departure from the European Union could trigger a series of unintended consequences across the UK itself, potentially setting the stage for Scotland’s secession from the country and a renewed round of clashes between nationalists and separatists in Northern Ireland.

Scotland and Northern Ireland both voted heavily to stay in the EU, a conflict that Scottish nationalists say gives them standing to withdraw from the UK and that has Irish nationalists clamoring to reopen the long-simmering debate over British rule in a northeastern corner of the island.

Scotland narrowly voted against independence from the UK back in 2014, was given big but as-yet-unfulfilled promises of greater autonomy, and voted by an overwhelming 62-38 margin to remain in the European Union.

Scotland’s first minister, Nicola Sturgeon, is an avowed Scottish separatist and said in the immediate aftermath of the vote that dragging Scotland out of the EU against the stated preferences of its citizens was a "democratically unacceptable" outcome and that a new referendum should be on the table.

The UK’s small and often troublesome Northern Ireland region also voted strongly to remain. Membership in the European Union greatly reduced the practical significance of the international border running through the island of Ireland and makes it easier for moderate Northern Irish Catholics to accept partition.

Northern Ireland is also poor enough to receive significant subsidies from the EU that are now set to vanish. The nationalist party Sinn Fein is taking advantage of the situation to call for a new referendum on Irish reunification at a time when unusual political circumstances in the Republic of Ireland also create a moment of opportunity for them.

It’s entirely possible that cooler heads will prevail and all this will ultimately be settled amicably, but it’s equally possible that the endgame here will be the dissolution not of the EU but of the UK — creating a new federal Ireland and European Scotland in its wake.

Scotland’s unsettled situation

Scotland and England have been intimately linked for centuries, but that relationship has frayed in recent decades, culminating in a 2014 secession vote that nearly passed but ultimately didn’t. With Brexit, that union is once again in doubt.

Scotland was politically unified with England back in 1707 but has always existed as not just a distinct administrative unit but a distinctive country. Scotland has an independent legal system, and even though the country has been in a currency union with England this whole time, Scottish banks issue different-looking banknotes and Scotland fields separate teams in international athletic competitions.

For the 250 or so years of the British Empire, this worked pretty well — as members of a United Kingdom, Scots were essentially junior partners in a glamorous game of global conquest, whereas an independent Scotland would have been a bit of a tiny, cold backwater.

The process of decolonization changed this context, and began to make some Scottish people see themselves as more the last of the people subjugated by the English than as co-subjugators. Then during Margaret Thatcher’s administration, a clear divide in party politics emerged, wherein the Scottish electorate proved to be consistently and durably more left-wing than English voters.

Into this breach stepped the Scottish National Party with the pitch that an independent Scotland wouldn’t so much be a tiny, cold backwater as another thriving Nordic-style social democracy just like Norway or Finland — countries that are, in fact, tiny and cold and sort of backwaters but that also regularly dominate international rankings of quality and life and serve as emblems of hope to left-wing intellectuals around the world.

When the Labour Party came to power under Tony Blair in 1997, it promised limited "devolution" of power to Scotland — creating a Scottish parliament with partial taxing authority and the right to organize many public services somewhat autonomously. This seems to have somewhat backfired, by creating a low-stakes environment in which soft nationalists could vote for SNP politicians — which gave the SNP a chance to govern and gain credibility.

Under Alex Salmond, SNP ran first a minority government in Scotland and then a majority one. The nationalists lost the independence vote in 2014, but the SNP won the hearts of Scottish voters in 2015 by turning out Labour Party MPs en masse in the general election and sending a huge slate of SNPers to the national parliament in London.

Leaving the EU could be a game changer for Scotland

For the past year, Scotland has been in an unsettled situation. Nationalists lost the vote but rule the roost politically, and opposition to UK Prime Minister David Cameron’s locally unpopular government took the specific form of SNP voting rather than support for Labour.

One problem the SNP faced during the referendum, however, was that while people liked the idea of nationalism, it was hard to make a practical case for it. The downside risk of launching a new country was clear, but the SNP’s vision involved relatively little practical upside. Scotland would, SNP said, form some kind of currency union with the "Rump" UK and would of course continue to be part of the EU and the Commonwealth, so things would just carry on as before.

With English voters guaranteeing some kind of economically disruptive breach with the EU, soft nationalists in Scotland may have second thoughts about what really counts as playing it safe.

In essence, Scotland needs to choose between membership in the UK and membership in the EU, now that maintaining the status quo is off the table. Forced to make some kind of disruptive change, the disruptive change that also asserts Scotland’s national dignity and cultural distinctiveness may look more appealing.

.@NicolaSturgeon addresses Europeans living in Scotland: "You remain welcome here. Your contribution is valued." https://t.co/p7G1oayxwr — Sky News (@SkyNews) June 24, 2016

On a more practical front, however, with the UK leaving the EU, an independent Scotland applying for EU membership would almost certainly have to adopt the euro as its currency. The euro has not, in general, worked well as an economic system, and the basic facts of geography indicate that Scotland’s economy is going to need close ties with England one way or the other.

A mess in Ireland

The history of Northern Ireland is far too complicated and controversial to adequately summarize, but a very simplified version of it would be that there is a corner of the island of Ireland whose population is split in terms of its national identity. A majority of Northern Irish people are Protestants who identify as "British," while a large minority of them are Catholics who identify as "Irish." This split has caused a lot of problems over the past 150 years for the people who live there and for governing authorities in London and Dublin.

For a while, these problems (known as "the Troubles") included the systematic exclusion of the Catholic minority from the institutions of government, frequent rioting, a campaign of terrorist violence, etc.

But since the 1998 Good Friday Agreement, the situation has been a lot more peaceful.

There is a sharing of power between the communities, an acknowledgement by Catholics that forcing the region into the Republic of Ireland against the will of its population would be wrong, and an acknowledgement by Protestants that it’s a weird situation and entirely acceptable for Catholics to want ties to the government in Dublin and to their neighbors across the border.

That the UK and Ireland are both members of the EU helps ease a lot of this in practice, because it means that the UK/Ireland border simply isn’t as significant as the average international border. That lowers the stakes of the question of which side of the border a given Irish-identifying person lives on, and makes it easier to perpetrate the series of fudges that are the cornerstone of any good peace deal.

Pulling the UK out of the EU risks repolarizing the situation by raising the stakes. Catholics still won’t have the votes they would need to unify Northern Ireland with the Republic of Ireland, but they may lose some of the ties to the republic that have dimmed nationalism’s appeal. If Scotland votes to quit the UK and the entire constitutional structure of the country is put up for grabs, that will further unsettle the situation.

UK politics is not going to pay attention to this

A further source of tension is going to be the fact that while these questions cut toward the heart of the UK’s constitution, they are marginal to its politics.

America’s biggest state, California, has one-eighth of the country’s population, and the institutions of federalism ensure that its role in politics is smaller than that. England, by contrast, contains more than 80 percent of the UK’s citizens, and its share of Conservative Party members of Parliament is even bigger than that.

The UK is also a parliamentary democracy featuring a Conservative majority in Parliament and a Conservative prime minister who has announced his intention to resign. So the big question in UK politics is going to be: Who do an overwhelmingly English set of voters pick to lead a party that has virtually no support in Scotland or Northern Ireland?

Their choice will have profound implications for Scotland and Northern Ireland but will not be made with Scottish or Northern Irish issues particularly in mind — which makes it particularly unlikely that the choice made will be one that helps settle the situation rather than exacerbate it.