When Margaret Thatcher won the support of 55 per cent of Conservative MPs in 1990, she resigned, feeling her authority to be fatally compromised.

By contrast, Jeremy Corbyn has the backing of just 17 per cent of his MPs, but is still in his job. He lost the support of his front bench, then of Labour MPs, and then of some of his newly appointed replacement front bench, but he’s sticking it out. Why? And what happens next?

The reasons for his tenacity are two-fold. First, there’s the principle: “respect the mandate” has always been the rallying cry of the Corbynites when faced with any internal opposition – he is, they claim, the grassroots made flesh and thus must stick it out no matter what the MPs might say. They see this as a temporary situation, while they wait for the Parliamentary Labour Party to change to match the leader’s office and the new grassroots. On Monday, a speaker at the Momentum rally ranted against “those unelected people” in Parliament, apparently unaware of the irony but brilliantly summing up the problem.

Second, there’s a practical reason for Corbyn not to quit. The legal advice he has received – and the advice from his Party officials – states that if he is challenged for the leadership while still in office then he will automatically be on the ballot paper. Due to the imprecise wording of the Labour constitution, rebel MPs had hoped that he would need to find sufficient signatures to stand again, and that they could deny them to him, and they claim to have their own legal advice to the contrary, but it seems like a highly optimistic reading of the rules. By not resigning, and instead forcing his opponents to mount a leadership challenge, he stands the best chance of ensuring he is able to defend his position.

So the first stage in ‘what happens next’ could be a legal row. The Party’s NEC is the ultimate internal authority on the rules (and, entirely uncoincidentally, Momentum sent out an email yesterday urging all Corbyn supporters to join in order to get a vote on the NEC’s membership) so will presumably arbitrate as to whether he automatically gets onto the ballot paper or not. Given that both sides have taken legal advice, that decision could be appealed in the courts by whichever group loses at that stage.

The best case scenario for Corbyn, therefore, is that the NEC recognises his automatic right to be a candidate for his own job.

Next best would be for the NEC to decide otherwise, but for him to then win in court.

A worse scenario would be a defeat at the NEC and in court, leaving him with only one available route remaining: using the threat of deselection by his massed grassroots support to force MPs to “respect the mandate” by nominating him, even if they really want him gone.

If he thinks that wouldn’t work, it is possible he might broker a deal. He would exit quietly, if in return the MPs were to guarantee a Corbynite candidate like McDonnell a place in the contest. That might win the backing of some left-wing MPs whose problem with Corbyn is more about his incompetence than his ideology. However, the bulk of more moderate Labour MPs would still be unlikely to find it an acceptable solution.

Worst of all, he might fail to secure an automatic place on the ballot or to get enough nominations through force or to strike a deal, effectively being excluded from the race via rule-book jiggery-pokery. At that point, it’s armageddon: cue a purge of MPs as his supporters take their revenge on those who brought down their hero, and/or a new Continuity Corbyn Party founded to attack Labour from the Left.

If he does end up on the ballot, through whatever route, what then? The worst case scenario for the rebels would be for him to be re-elected on another thumping majority of the grassroots. That’s entirely possible – those £3 members are still on the books and show little sign of abandoning their man, no matter how disastrous he may be. In that situation, the coup attempt would have badly misfired, leaving Corbyn stronger than before – various MPs would presumably conclude their Party was lost to them for good, and resign either the whip or their seats – abandoning the Labour Party wholesale or splitting it. If any rebels chose to fight on, there’s a high likelihood they would face challenges from enraged Corbynites in their CLPs.

Next best would be for the rebels to defeat him by playing Momentum at their own game. Some are already encouraging anti-Corbynites to join or rejoin the Party in order to defeat him and “save Labour” – effectively mounting a grassroots takeover of their own. It would be impressive if they manage it – not least because it’s hard to see where over 200,000 such people are going to come from – and it would boost their Party to still greater heights of membership, but it would also set the scene for an outright civil war, with two large factions instantly at each others’ throats. The rebels would say that having half of a divided party is better than having no party at all, and they’d be right, but it would still be less than pleasant.

Best of all for the moderates would be to defeat Corbyn in a ballot of the existing membership – demonstrating that even those who once believed that “Jez we can” have now realised that Jez, in fact, really can’t. It’d be a vindication of their concerns, a return to sanity after a plunge into the bizarre world of the hard left and a victory which would re-establish the dominance of a far more electorally successful tradition of Labour politics. But if it sounds like a fantasy, that”s for the very good reason that it is one. The Corbynites are here, they’re doubling down on their commitment to their revolution and, despite everything, very few of them show any sign of doubting their faith in their hero.

In short, all the likely possibilities for what comes next are very messy indeed.