The story of Britain and Ireland’s relationship has, all too often, been one of mutual incomprehension: 1066 and All That summed up the view on this side of St George’s Channel with the line that ‘Every time the English tried to solve the Irish question, the Irish changed the question.’ But Theresa May’s problem right now is that the Irish — and the European Union — won’t change the question and the only answers they’ll accept are unacceptable to Mrs May and her cabinet.

To the astonishment of many, the Irish border has become the defining issue of Brexit. There is now a serious and growing risk that the issue will lead to the UK and the EU failing to reach a withdrawal agreement — with all the dire consequences that would entail.

It’s easy to see why the issue didn’t receive the same attention during the referendum campaign. The Irish border is 300-odd miles long with trade of about £6 billion going across it; the Dover-Calais trade is worth 20 times that. But the problem is harder to solve because the EU is saying that, while it is prepared to wait to solve all the other trade issues, it wants the Irish situation resolved by the time Britain formally leaves the EU in March.

The EU’s proposed solution is crude. It wants to maintain frictionless trade on the island of Ireland by, if it deems necessary, imposing checks on trade between Great Britain and Northern Ireland. It is a rhetorical trick to say that this safeguards the Good Friday Agreement. This EU plan violates the delicate balance struck by Good Friday more than Brexit does. It would ease Northern Ireland away from the UK and push it more towards Dublin’s orbit. Under the Barnier plan, if a Northern Irish business objected to a proposed new regulation, its best bet would be to lobby a member of the Irish government. You don’t have to be from the ‘Ulster Says No’ school of politics to regard this threat to Northern Ireland’s status as unreasonable, even provocative.

The EU has always had three conditions for a Brexit deal. Britain must agree how much it will pay in the future, even before we know what we’ll be getting in exchange for the money. Next, the EU wants to resolve the rights of three million EU citizens already living in the UK (which ought to be easy). The final condition is Ireland. This bit never quite made sense: how could Irish border arrangements be finalised, without knowing what the post-Brexit trading relationship would be?

But the EU wanted Ireland included to show that this small member state wouldn’t be hurt by its large neighbour leaving. As one Secretary of State said to me recently, Brits don’t quite appreciate how much the EU regards itself not just as a postwar peace pact, but as a way of stopping small states being pushed around by large ones. The Greeks would be entitled to a wry smile at that.

More importantly, the EU also realised that insisting on progress in Ireland could tie Britain’s hands in the trade negotiations to come. And if Britain had also signed away the money in the withdrawal agreement — which is the plan — Brussels would have got the Brits to throw away their best cards before the main negotiations even began. They remain tantalisingly close to this goal.

In a post-election panic, Theresa May went along with this bizarre sequencing of the talks: agreeing money, agreeing Northern Ireland, and then discussing everything else. Worse, she accepted the argument that any additional infrastructure at the border could not be accepted for security reasons. So the obvious solution — using technology — was in effect ruled out. This is why the talks are taking so long: every time the EU stalls, the Prime Minister comes under more domestic pressure and then offers more up to the EU.

At various points, Mrs May’s negotiators have believed they were the clever ones, that they could somehow use the Irish border issue to get the EU to agree to a special deal for the whole of the UK. After all, what could work on the Irish border could surely be applied to the English Channel too. As late as last month, the government believed that it could pressure the EU to engage with its Chequers plan, that would have seen the UK effectively remain in the single market for goods and preserve several of the benefits of customs union membership, on the basis that it was the only approach that worked for the Irish border. But despite positive sounds from the Irish, this pleading had no effect on Brussels — and was rejected, in brutal form, by the European Council President Donald Tusk in Salzburg.

Mrs May now stands embarrassingly exposed. In December she signed up to a plan saying that if the trade talks failed, the UK would offer guarantees on Northern Ireland. It would ‘maintain full alignment with those rules of the internal market and the customs union which, now or in the future, support North-South co-operation, the all-island economy and the protection of the 1998 Agreement.’ What did this mean? At the time, No. 10 told ministers it didn’t mean very much: just making sure UK standards were no lower than European ones. Don’t worry, No. 10 insisted, it will all become clear in time.

But in one of the many inexplicable acts of incompetence by the UK government during this process, the government didn’t seek to put its interpretation into writing. When the EU produced its own legal definition, it became clear that No. 10’s assurances had been wrong. Mrs May had signed a document agreeing that, in the event of the trade talks not delivering a solution, Northern Ireland would follow EU rules — even if Britain did not. She had unwittingly given herself a choice: soften Brexit beyond all recognition or abandon Ulster.

May was quick to declare that jettisoning Northern Ireland would be unacceptable to any British PM. But in truth, it was particularly unacceptable to her because she is reliant on the Democratic Unionist Party for her parliamentary majority. On nearly every issue, the DUP have a price. But not the Union: that is priceless to them. If they sense that Mrs May is putting the Union at risk, there will be no repairing that breach, no matter how much special funding for Northern Ireland is on offer.

May is now faced with an unpalatable choice: a Northern Ireland-specific backstop that would enrage the DUP, alarm the Scottish Conservatives and upset Unionist MPs, or a UK-wide backstop that would allow us to leave only with the EU’s permission. This would enrage her party and be the bad deal she has so often warned about.

On Sunday Dominic Raab, the Brexit Secretary, went to Brussels to stress that a deal couldn’t be done on these terms. Mrs May cannot proceed with anything that leaves her choosing between stiffing the DUP or stiffing the Brexiteers. But the EU is unsympathetic: Michel Barnier worked hard to back the Brits into this corner. Why let them escape now? The widespread belief in Brussels is that the UK will, in time, swallow whatever deal is offered — however unpalatable — because Mrs May has closed off all other options. It sees how the UK has backed down before in these talks. It sees how little serious no-deal planning has been done. It calculates that there is another climbdown coming. But this is a dangerous assumption. It overestimates Mrs May’s room for manoeuvre. Tellingly, when she met the cabinet this week, no one wanted to accept what the EU was offering.

What happens next? Well, the best option in the current circumstances is an all-UK backstop that would come with an exit mechanism. The House of Commons would almost certainly prefer this kind of deal to no deal.

Another option is being whispered about in private by cabinet ministers: a mitigated ‘no deal’. The UK would pay the EU money in exchange for a series of mini agreements that would ensure that the planes could keep flying, that customs checks were kept as manageable as possible, and the EU and the UK could trade together in the way that advanced economies do when they don’t have a trade agreement. It would be expensive. I understand that at cabinet this week Philip Hammond explicitly argued that the UK should pay the EU almost all of the £39 billion, even if it leaves without a deal, to facilitate these kinds of arrangements. An acrimonious no deal is still an option, with Mrs May reneging on whatever she promised last December — with significant disruption. Ironically, this would hit Ireland as hard, if not harder, than the United Kingdom.

There has been a subtle shift in recent days within the cabinet. Ministers who used to say Britain could not possibly leave without a deal are now starting to say they could not possibly give in to this pressure from Brussels. One cabinet member — a Brexit swing-voter — now believes Mrs May should start to tell voters how tough no deal will be but that the EU may well have left us with no respectable alternative. The threat of cabinet resignations has also receded (for the time being). Nothing is being agreed with the EU, so there is nothing to walk out over.

But no deal still poses a host of problems. First, the lack of preparation — which is, amazingly, deliberate. Mr Hammond was reluctant to fund no-deal planning, worrying that if he gave his colleagues a plan for how to deal with no deal, they’d take it. Serious planning only started this summer. It would be a special kind of incompetence to end up in a no-deal scenario, while not having properly prepared for it. Public anger at EU intransigence would soon be replaced with irritation at the bungling British government.

This is assuming that no deal is allowed to proceed. The reason that so many Remain-leaning MPs put up with John Bercow staying as Speaker — despite the culture of bullying he has presided over — is because they think he’ll help them block a no-deal Brexit.

A second referendum is still a possibility. Voters would be asked to choose between a no-deal Brexit, or abandoning the whole idea of Brexit. With the Tory party split on what to do, handing this choice over to the electorate might become the easiest thing to do. The EU would certainly move the March deadline, if it thought the Brits would come crawling back. Or there could be a reason-able deal. But that would require both sides to realise what the other can and cannot accept. The EU cannot expect the UK to, essentially, cede a part of its territory. Nor can the UK expect to keep so many benefits of EU membership, having decided to leave.

The issue of the Irish border has made both the UK and the EU forget these truths. But if no deal is agreed, the outcome would be precisely what both sides say they do not want: a hard border in Ireland.

At various points, Mrs May's negotiators have believed that they were the clever ones