Polls show a majority of Conservative supporters prefer to see the U.K. walk away without an agreement on April 12, something Ms. May opposes. Meanwhile, Mr. Corbyn’s own views of EU membership are at odds with his followers. He voted against the U.K. joining in 1975 and was a lackluster campaigner for "remain" in 2016. But a poll by a pro-Labour trade union projected a loss of 45 seats in a snap election if the party fails to oppose Brexit.

Conservative Prime Minister Theresa May and her opposition rival, Labour leader Jeremy Corbyn, have struggled to unite their fractious parties around Brexit positions that don’t sink them politically, now or in the future. Both leaders are wary of any compromise that delivers Brexit but cleaves their respective parties into “remain” and “leave” factions.

Whatever side of the Brexit debate one is on, there is no disagreement that it is a confusing, messy process. Some of that is rooted in the philosophy of Brexit itself: whether it is better for the United Kingdom to remain within the European Union or not. But another major factor is a common political issue: the tension between party and country.

When Prime Minister Theresa May reached across the aisle last week for help in delivering Brexit, her eleventh-hour pivot had an air of inevitability. Her own Conservative Party had failed to back her withdrawal agreement with the European Union on three separate votes in Parliament, humiliating Ms. May and forcing her to extend the United Kingdom’s March 29 deadline for departure.

Without a majority on her own benches, Ms. May has held talks with the opposition Labour Party in a bid to pass the withdrawal agreement on time. On Sunday, she made a pitch to the public in a presidential-style video from a sofa in a wood-paneled office.

“It’ll mean compromise on both sides, but I believe delivering Brexit is the most important thing for us. I think that people voted to leave the EU. We have a duty as a Parliament to deliver this,” she said.

Outside observers might wonder what took her so long.

The reason lies in the tension between party interests and national interests – something familiar to leaders everywhere. While the demands of party invariably come into play, politicians usually look for ways to square them with what they perceive to be best for their country.

Ms. May and her opposition rival, Labour leader Jeremy Corbyn, have struggled to unite their fractious parties around Brexit positions that don’t sink them politically, now or in the future. Both leaders are wary of any compromise that delivers Brexit but cleaves their respective parties into “remain” and “leave” factions.

Divided parties

Ms. May has “very clearly been putting the interest of party unity first,” says Amanda Sloat, a senior fellow in the Center on the United States and Europe at the Brookings Institution. But she has failed to win over her own pro-Brexit members of Parliament who demand that the EU makes more concessions, particularly on intra-Ireland trade, says Ms. Sloat. Now “the only alternative is to pivot in the other direction and try to get some support from Labour MPs.”

Some Labour MPs would be happy to oblige: Their constituencies voted to leave and look dimly on Parliament’s foot-dragging. “You do have a majority of MPs across the house who would be supportive of some kind of softer Brexit,” says Thom Brooks, the dean of Durham Law School in Durham, England, and a professor of politics.

In the nomenclature of Brexit, “soft” means keeping the U.K. in a tighter future embrace. Mr. Corbyn has called for a customs agreement to duplicate the current arrangements that provide frictionless trade for U.K. companies across Europe, as well as EU-adopted protection for workers’ rights and alignment with other EU regulations.

Matt Dunham/AP A pro-Brexit, leave the European Union supporter holds up placards outside the Houses of Parliament in London on April 3.

But the idea of a soft Brexit, or any Brexit at all, is anathema to the majority of Labour members who voted to remain in the 2016 referendum. A recent petition calling for the revocation of Britain’s departure got over 6 million signatures within a week, a record response. Many came from Labour-voting seats that are more youthful and pro-European and support holding a second referendum on Brexit as a condition of Labour cutting any deal with Ms. May.

Yet the same petition reveals a fault line within Labour that parallels Ms. May’s dilemma. Some of the constituencies with the fewest signatures were also Labour seats, mostly in working-class districts away from the affluent southeast. These seats could be crucial to any future electoral victory for Mr. Corbyn, whose surge in 2017 cost Ms. May her parliamentary majority.

But younger voters could turn against Mr. Corbyn if he’s seen as abetting a Conservative-led Brexit, says Steven Fielding, a professor of political history at the University of Nottingham. “Young people didn’t vote Labour in order to support Brexit,” he says.

A poll by a pro-Labour trade union projected a loss of 45 seats in a snap election if the party fails to oppose Brexit, the Guardian reported in February. More immediately, Mr. Corbyn has to keep onside critics in his shadow cabinet who have campaigned for a second referendum and prevent more defections in Parliament to a new independent caucus.

Mr. Corbyn’s own views of EU membership are at odds with his followers. A lifelong socialist, he voted against the U.K. joining in 1975 and was a lackluster campaigner for remain in 2016. His left-wing allies oppose EU rules that restrict state spending on national industries.

Helping Ms. May to deliver Brexit would allow him to return to his attack lines on the economy, says Mr. Fielding, who is writing a history of the modern Labour Party. “Brexit is a complication for him. ... His basic path to victory is to get Brexit out of the way with as little damage as possible.”

‘What an astonishing achievement’

For Ms. May that isn’t an option; she has already agreed to step down if and when Brexit happens. But her right flank is livid at her pivot to Mr. Corbyn, a left-winger they despise. A letter published last week in the pro-Conservative Telegraph pithily described this anger: “SIR – Mrs May is despised by much of the Labour Party simply for being a Tory. She is now despised by much of the Tory party for not being a Tory. What an astonishing achievement.”

Polls show a majority of Conservative supporters, though not MPs, prefer to see the U.K. walk away without an agreement as an EU-imposed deadline looms on April 12. Ms. May is attending an emergency EU summit on Wednesday to seek a longer extension.

Even if Ms. May and Mr. Corbyn can eventually agree on a Brexit strategy to put to Parliament, its approval would not end the drama, given the tensions within both parties, warns Ms. Sloat. MPs still need to legislate in support of Brexit and rebellions may prove hard to contain.

“Theresa May needs a parliamentary coalition not only to pass the deal but also to pass implementing legislation. It’s not enough to just get this agreement and then see Parliament collapse,” she says.

In Britain, the historical parallel for Ms. May’s dilemma is the 1846 repeal of the pro-landowner Corn Laws, which split the Victorian-era Conservative Party and cast it out of government for three decades. The repeal was in the national interest, but not in the interest of the ruling party.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

The irony for today’s Conservatives is that the 2016 referendum was supposed to settle a perennial intraparty war over Europe. Conservative Prime Minister David Cameron called the referendum believing that he could win and thereby modernize a party that was “banging on about Europe,” not voters’ daily concerns. Instead he set the U.K. on a path that has made EU relations more polarizing than ever – and destabilized his own party.

“This is a crisis entirely formed by an existential problem of the Conservatives,” says Mr. Brooks.