The Conservatives worked hard to win their first majority for 23 years in 2015. And Theresa May squandered it after two. This stark fact - and the Tories’ dismal campaign - explains the fury with which Conservative MPs responded to the election result.

When the exit poll was published, some expected May to be gone within days (becoming the shortest-serving PM since Bonar Law in 1923). But though she enraged MPs with her initially defiant statement, she acted swiftly to shore up her position.

Fiona Hill and Nick Timothy, her fiercely loyal aides, fell on their swords and the cabinet’s senior members were reappointed. May accepted the inevitable transition to a form of government in which she is in office but barely in power.

The Prime Minister pleased the Remainers she previously alienated with the appointment of the well-liked Gavin Barwell as her chief of staff and Tory wet Damian Green as First Secretary of State. The Brexiteers, meanwhile, were consoled by the appointment of Steve Baker, the chair of the European Research Group, as a junior DEXU minister. But without an overall majority (the Conservatives fell eight seats short of the 326 required), May’s position will remain permanently fragile.

Even if a confidence and supply arrangement is reached with the DUP, only nine Tory rebels will be required to defeat the government (May will have a working majority of 17 once the seven Sinn Fein MPs [who do not take their seats], the Speaker and his three deputies are excluded).

The Prime Minister’s fate, a senior Conservative told me, will “depend on arithmetic”, echoing LBJ’s dictum that the first rule of politics is “being able to count”. May must keep multiple and opposing factions on side. Senior Brexiteers believe much will depend on how assertive the Conservatives’ 13-strong Scottish bloc prove (their leader Ruth Davidson is championing an “open Brexit”).

Eurosceptics, such as Iain Duncan Smith, have defended May as the guardian of Brexit (“she’s given us everything we’ve wanted so far,” one told me). But there is now a parliamentary majority for a significantly softer exit and a cabinet push led by Philip Hammond (who May was too weakened to sack).

For now, two things are holding May in place: the fear of an early election and the fear of something worse. Labour’s surge has left the Tories dreading defeat if they go to the country again. As I noted last week, the opposition needs a swing of just 1.6 per cent to become the largest party and one of just 3.6 per cent to achieve a majority. Were the government to lose a confidence vote, an early election would follow unless an alternative administration could be formed within 14 days.

Last summer, May became Conservative leader as the candidate most MPs could live with. This broad but shallow support similarly sustains her now. “The Remainers fear Boris [Johnson], the Brexiteers fear Ruth [Davidson],” a Tory MP told me. Some believe there is even merit in allowing a zombie prime minister to “own Brexit”, ensuring May’s eventual successor is untarnished.

But two things are certain: May will never lead her party into another election and she will only remain prime minister as long as the benefits of retaining her outweigh the costs. Should the calculation change, her downfall will be swift.

Conservative leaders are easier to remove than Labour ones, owing to the former’s regicidal nature and less protective rules. Only 48 Tory MPs (15%) are required to trigger a confidence vote in a leader, who must resign if defeated. The rebels need only submit private letters to Graham Brady, the chair of the 1922 committee, and are guaranteed anonymity.

Far earlier than she hoped, May has learned the iron rule of Conservative politics: once a leader is judged a loser they will only serve as long as the party wants.