(Justin Tallis/AFP/Getty Images)

One of the more vexing questions about Thursday’s Brexit vote is, “Why is it occurring?”

If Prime Minister David Cameron is so convinced that Britain exiting the European Union would be such a tremendous existential mistake, why was he the one who called for the referendum three years ago? Even as recent polls may be slightly tilting toward favoring the Remainers, does this not stand as a huge political misstep, an own-goal kick in an already close game, an injection of unnecessary uncertainty into an already complex economic and political relationship?

There are compelling arguments on both sides, and yes, I’m operating with 20/20 hindsight. But in calling for this referendum as a political preservation strategy, Cameron, like many of our own conservatives, failed to assess a set of dangerous risks, most notably, the unleashing and legitimizing of deep anti-immigrant sentiments.

Even rookie lawyers know you try to avoid asking questions to which you don’t know the answer, and rookie politicians know you don’t kick the political equivalent of a hornet’s nest by raising highly contentious issues if you can avoid doing so. Cameron’s rationale for bucking such common sense is typically given as an absolute political necessity: Had he not thrown this bone to the Euro-skeptics, he risked splitting conservatives between his Tory party and the anti-immigrant UKIP party along with a handful of other right-wing anti-EU conservatives. Such a split, Cameron feared, could toss the 2015 election to Labour.

His calculus, some say, included a failsafe: his prospective coalition partner in the next government, say the centrist Lib-Dems, would block the referendum, leaving Cameron shedding crocodile tears as he falsely bemoaned not being able to follow through on his pledge.

As it turns out, the conservatives so handily vanquished Labour in the subsequent election that there is no coalition partner. But back then, the polls were tight and there is a reasonable argument his plan might have worked. Moreover, as Financial Times columnist Janan Ganesh puts it, absent a pledge to hold the referendum on leaving the E.U., “Mr Cameron would certainly have succumbed to mutinous forces … [and a] referendum would have been held eventually anyway, most likely by a Conservative prime minister set on leaving.”

But there’s also a history here, and it’s relevant in light of our own challenging political moment. Much like our conservatives, Cameron has long played with this sort of fire, linking up with nationalists and UKIP-types to garner support, with too little appreciation that if you fan those flames long enough, you’ll eventually get burned.

In both the United Kingdom and United States, this tactic of tilting to your far right to sustain your establishment, or center-right, has released a hateful and even tragically violent torrent of xenophobic dissent. More than one of my British friends has told me they’ve been taken aback by the ugliness of the Brexit debate. Meanwhile, on this side of the pond, even Trump’s supporters protest his racism (though via partisan tribalism, still maintain their support for him).

But again, could or should it have been otherwise? If a significant share of the U.K. electorate truly feels so negatively about E.U. membership, should they not, in a democracy, be able to vote their position?

Superficially, sure. But in the real world, referendums often have a way of bringing out the worst in people. For all the talk of economics, GDP, currency unions, trade and geopolitics, “The essence of this referendum,” as Ganesh perfectly summarizes it, “is ‘Do you dislike immigration more than you like economic calm?’”

Especially given the collision between the freedom of movement across the E.U., much like the freedom of movement between our states, and the refugee crisis, the question Ganesh poses becomes a slam dunk for many Leavers. I’d add that given the E.U.’s aggressive fiscal austerity and dismal growth record in the eurozone, “economic calm” may not seem like it’s quite on the ballot this Thursday.

As a friend recently said to me, “Imagine if we had such a referendum on immigration in this country. The haters would be out in force, and they’d bring their weapons.”

Except we pretty much are having that referendum in the form of our general election. While there are many factors that explain the rise of Trump, most notably his outsider status in an anti-establishment Republican primary, it was his stance on immigration that first “elevated” him from the pack. He argued that undocumented immigrants were “murderers and rapists,” he’d deport the millions who are here now, and then build a wall to keep them out.

To many Americans, this reeked of hatred, racism, and economic recklessness. But to millions of Republican primary voters, stoked by years of conservative rhetoric about how the “others” are ripping them off, it made visceral sense, and even if Trump loses, he will have unleashed an anger that is unlikely to go away soon.

If Brexit fails — if the Remainers prevail — the U.K. may well be left in a similar situation. By tapping an opportunistic political strategy, Cameron let an evil genie out of the bottle, the same one Trump has evoked over here. At least Cameron is trying to put it back.

He may succeed, and Ganesh’s argument that it couldn’t have been otherwise may be right. But with hindsight, it looks to have been a terribly reckless strategy with consequences that will reverberate for years. I’d say the same for our conservatives, who are also reaping what they’ve sown, at great cost to our national unity.