As the fallout from the Brexit vote continues, attention has turned to Labour, which is in the middle of a full-blown coup by the shadow cabinet against the party leader, Jeremy Corbyn.

Senior figures have blamed Corbyn for failing to mobilize Labour voters to support remaining in the EU, although their grievances are much longer standing.

Despite a vote of no confidence, Corbyn has insisted he won't resign, citing the large mandate he won in the 2015 leadership election, when he finished 40 percentage points ahead of his nearest challenger in a vote of party members.

The confidence vote has no constitutional status – a Labour leader can be formally removed only via a leadership contest. But it is a damning indication of the collapse in support for the leader among MPs. The Brexit vote, far from causing this crisis, has merely brought matters to a head – the entire party is in a mess. A bitter struggle between the Parliamentary Labour Party (PLP) and Corbyn and his backers in the mass membership and the trade unions is underway.

Corbyn's refusal to resign is not surprising. If he did step down, he would be handing the party back to Labour's "moderates" in the PLP. For the left wing of the party, that would be disastrous. Not only would it lose its ideological figurehead, it would sacrifice the post-Corbyn leadership of the party.

A resignation would create a vacancy and in such circumstances, Labour's rules require candidates to be nominated by 15% of Labour MPs and MEPs, which would currently be 38 MPs/MEPs. There is little prospect of a radical leftist gaining that much support. Thus, any leadership contest would consist mainly of "moderates", irrespective of what the party members thought. For that reason, left-wingers would have been desperate for Corbyn to remain.

A party at war with itself

The conventional wisdom about party leaders is that they must retain the confidence of their senior colleagues to survive. These are the people who work with the leader daily, engaging in collective decision-making, representing the party in parliament and speaking for it in the media. Without that confidence the leader's authority ebbs away. It can only be a matter of time before they have to resign.

But there is nothing conventional about Corbyn's leadership. He originally secured the necessary nominations of 15% of MPs only because some loaned him their support to help him onto the ballot.

Despite the mass resignation of shadow cabinet members, Corbyn feels emboldened to resist calls to go. Losing their confidence doesn't mean much when he never enjoyed it in the first place.

Instead, Corbyn's base is among the new members who flocked into the party to support his leadership campaign. He also retains support among Labour's major affiliated unions.

If Corbyn can rely on the unions and party members, he will feel confident of winning another leadership ballot. That would be decided by a vote of party members, affiliated supporters (trade unionists) and registered supporters, who last year paid £3 each to vote. Unless there is a collapse in Corbyn's support among ordinary members and supporters, he would be well-placed to win again.

Here's the rub

There is a major sticking point though. It's not entirely clear that Corbyn could actually participate in a new leadership election. Labour's constitution stipulates that any challenger who wishes to contest the party leadership against an incumbent leader (as opposed to contesting a vacant post) must be nominated by 20% of Labour MPs and MEPs, which would currently be 51 MPs/MEPs. But the rules are ambiguous as to whether the leader also needs to secure 51 nominations or whether their name would go on the ballot automatically.

Aware of the ambiguity, it appears Labour took legal advice on the issue, although reports of what that advice was are conflicting. Corbyn seemingly believes he could participate without needing 51 nominations, which he would be most unlikely to obtain. His opponents disagree. It could fall to Labour's National Executive Committee (NEC) to make a ruling. It is ideologically split, but union members would likely side with Corbyn. The entire matter could conceivably end up being settled in court.

The matter could be clarified by a change to Labour's constitution, but that would have to wait until the party conference in September. By that time Labour's rebels would hope to have removed Corbyn.

It also holds a danger for them. Constitutional changes are decided by a majority vote at the conference. If the big unions backed left-wing plans, already in gestation, to decrease the nomination threshold for leadership challenges from 20% of MPs/MEPs to 5%, then any new "moderate" leader who replaced Corbyn could quickly find themselves the target of a left-wing challenge the following year. It shows that procedural ruses – by either side – will achieve only short-term advantage that could store up further problems down the line.

Ultimately, Labour's warring factions will have to try to unite the party if they are to avert a collapse or a split. That could mean a more center-left leader who commits the party to opposing austerity, but who has greater electoral appeal than Corbyn. As things stand, worried Labour MPs might have to settle for surviving a general election, rather than hoping for their party to win one outright.

For their part, the grassroots left might need to acknowledge that leaders of major parties do require the support of their senior colleagues if they are not to become ineffectual and subject to endless plots and rumors. But with the battle barely begun, such reconciliation looks a long way off.