The least important consequence of Theresa May’s dawn breakthrough in Brussels is that it might well have saved her premiership. After Monday’s Brexishambles, in which the prime minister had to tell Jean-Claude Juncker to put the cork back in the champagne thanks to a party-pooping call from the DUP, the clock was ticking on the prime minister. Failure to strike an agreement that satisfied both her Belfast allies and the negotiators in Brussels would, in the eyes of many Tory MPs, have removed the chief justification for her continued tenure in Downing Street: namely, that she can deliver Brexit. The Tory regicidal instinct, never still, was twitching.

Today’s declaration that the talks had made “sufficient progress” has pacified that urge for a while. As things stand, Tories are minded to allow her to stay until the end of March 2019, to see through article 50 and Britain’s exit from the European Union. They know that’s bound to be a horrible job so, for now, they’re happy to let her do it.

But, to repeat, that’s the least significant aspect. More important, because it is a matter of the country’s future rather than one politician’s career, is that the “no deal” scenario has receded. It hasn’t disappeared, but it has become less likely. That explains the ill temper of Nigel Farage and his successor as Ukip leader, Henry Bolton, who declared May’s move a “total surrender to the European commission”. They, and the hardest Tory Brexiteers, were yearning for the deadlock that would have justified Britain storming off and slamming the door. Instead a phased departure looks to be the most probable outcome.

How did this come about? Like any deal, it required all the key players to have their own reasons for preferring agreement to failure. For May, the motive was obvious. Not only was her career hanging by a thread, but she could see what’s clear to all but the most wild-eyed Brexiteer: that no-deal would be an economic catastrophe. That’s why she was ready to give ground on all those EU demands where once her government struck such an unbending pose – including paying the hefty divorce bill and accepting that the writ of the European court of justice will run until at least the late 2020s.

You can also see why the DUP eventually fell into line. They wanted reassurance that Northern Ireland was not going to be treated any differently from the rest of the UK – a defining tenet of Ulster unionism – but they were never likely to push May too far. They don’t want to see this government collapse followed by fresh elections. They don’t dare risk the elevation of Jeremy Corbyn, whom they remember as a republican sympathiser during the era of the Troubles. Besides, the current, rather lucrative arrangement, in which they hold the government’s fate in their hands, suits them very well.

Most interesting is the European willingness to shake hands. Farage will say that’s hardly a surprise, given May’s capitulation to the EU’s key demands. But we know that Brussels had resolved from 24 June 2016 onwards to make Brexit as painful as possible, seeing its potential as an instruction video for any other member states that were considering making the same mistake. In which case, why not let May, and Britain, suffer a few months longer?

I’m told the EU believes it has already made its point: the remaining EU27 can all see that Brexit will cost Britain dear, starting with that bill, estimated at around £40bn. With that done, they are keen to put Brexit to one side, lest it consume any more European energy than it needs to. The French and Germans, in particular, have big European ambitions – including on defence and security – and believe now is a good moment to advance them. Their economies are ticking up nicely, just as Britain’s is lagging; the migration crisis is not as pressing as it was; and the UK is not around to block their plans. They want to seize this moment, rather than be tied up with the chaos of a British crash exit.

What’s more, they didn’t want to risk the toppling of May. For them, she’s a known quantity. And she’s promised them the main thing they wanted: money. Better to have her across the table than be faced with, say, Boris Johnson or another ardent Brexiteer keen to demonstrate his Europhobic resolve. So they decided to help her: hence today’s torrent of condescending praise from Juncker and the others.

And yet what was agreed was not much more than a series of convenient fictions, starting with the notion that the transition will last only two years. Everyone involved believes it will take much longer than that – five years is a minimal estimate – not least because Michel Barnier, the EU’s chief negotiator, reckons substantive talks, beyond merely outlining the key areas, won’t even begin till January 2019. But it suits them all to pretend otherwise.

More important is the delicate piece of fudge cooked up on the core question of a hard border between Northern Ireland and the Republic. The crucial sentence – in paragraph 49 – promises that, in the absence of a full UK-EU agreement, a hard border will be avoided by ensuring “full alignment” between the UK and those rules of the single market and customs union that directly bear on the relationship between the republic and the north.

Now, that could play out in one of three ways, depending which of the current red lines turns out to be pinkest. It could mean that the entire UK will end up being in full alignment, in which case it’s the softest possible Brexit: a Bino –Brexit in name only – to cheer remainers.

Or, if that prospect is simply unacceptable to the Tory Brexiteers, it could mean those EU-friendly rules apply to Northern Ireland only – a stance unpalatable to the DUP and most Tory unionists, and explicitly ruled out in the very next paragraph of the agreement. Or, third, all these conflicting promises prove irreconcilable, and Ireland ends up with a hard border after all.

My inner pessimist has long suspected that will be the eventual outcome. Of those three red lines, the hard border in Ireland is surely the one least theologically sacred to Tory Brexiteers. It matters to the Irish enormously, of course, but Dublin will find itself squeezed between Westminster political logic on the one hand and the logic of Brussels on the other. For the EU does, and will, insist on policing its external frontiers. Consider that there are border posts separating Norway and Sweden – it takes a lorry about six minutes to get through – and Norway is actually in the single market.

“The Irish were always going to lose out,” says Charles Grant, director of the Centre for European Reform, ruefully. “If Britain leaves the single market and customs union, there has to be a hard border.” They might find diplomatic language to dress it up, they might call it a soft boundary, but a hard border it will be. Privately, Barnier’s team admits as much.

This, then, is the moment of reckoning that today’s agreement postpones. What matters to the current British government more: avoiding a hard border, or breaking free of the single market and customs union? The dispiriting news for remainers hoping to prevent the national calamity of Brexit is that we surely know the answer.

• Jonathan Freedland is a Guardian columnist