The general verdict at Westminster is that Theresa May is not much good at politics. But there is one arena in which this consensus is incorrect: reshuffles. MPs and journalists alike tend to deride May’s cabinet appointments because they assume that the Prime Minister shares their diagnosis of the last election and the next: that she was to blame for a disastrous campaign that turned a Conservative majority into a hung parliament. Under that reading, May’s main job is to refresh the party’s top ranks in order to develop an adequate leadership replacement.

But the Prime Minister herself has a different objective: managing the top ranks to ensure her long-term survival. Someone who was deeply interested in the long-term future of the party would not have delegated control over the junior ministerial moves in January to Gavin Barwell, her chief of staff, and Julian Smith, the government Chief Whip. However, her own top-level reshuffle that month managed to keep the Remain/Leave factions balanced and successfully cleared the Department for Education of the two ministers – Justine Greening and Jo Johnson – who hoped to block her plans to cut tuition fees. (An independent review into higher education funding is expected to recommend a cut in the headline rate when it reports back in 2019.)

That follows an established pattern. After the disastrous general election result last year, May stripped her ally Damian Green of his work and pensions secretary post and shunted him into a manufactured role in the Cabinet Office. This created space for Michael Gove to return from the back benches.

These moves addressed several problems: May couldn’t risk leaving a dangerous enemy such as Gove in the wilderness for too long, but she was also too weak to sack anyone. Giving Gove the environment brief kept him in the tent, but agitating harmlessly about wildlife and plastic straws, rather than interfering in a policy area where she and he are at odds. Her treatment of her old friend Green called to mind the then Liberal MP Jeremy Thorpe’s one-liner about Harold Macmillan’s purging of his cabinet in 1962: “Greater love hath no man than this – that he lay down his friends for his life.”

Similarly, May’s emergency reshuffle on 30 April was an astute bit of firefighting. In Sajid Javid, her new Home Secretary, she has promoted a Conservative cabinet minister who plausibly can speak with personal understanding of the fear and anger felt by Commonwealth Britons affected by her “hostile environment” policy.

May also took the opportunity to bring back one of her favourites, James Brokenshire, who quit the cabinet to undergo surgery; he now fills Javid’s shoes as Secretary of State for Communities. While Brokenshire did not distinguish himself as Secretary of State for Northern Ireland, he is one of parliament’s few genuine May loyalists, and his return makes her position a little more secure, for now.

The elevation of Javid brought positive headlines. However, it also demonstrated how badly the Prime Minister has managed in the interval between reshuffles. A year ago, May hoped to fire Javid – who ran for the leadership in 2016 on a joint ticket with the now disgraced Stephen Crabb: the axe would have fallen after her expected landslide victory over Jeremy Corbyn on 8 June.

May and Javid are politically opposed on most issues. She is a pro-state interventionist; he is a classical Thatcherite. She favours strong borders, but he made a point of ostentatiously abandoning her “hostile environment” vocabulary in his first appearance before the Commons. The division even extends to science fiction: Javid is a Star Trek fan, while May prefers Doctor Who.

Yet, thanks to May’s decisions – a disastrous election campaign that sharply limited whom she could hire and fire; the 2016 Immigration Act, which led directly to the fall of Amber Rudd – Javid is now one of the heavyweight contenders for the leadership. (Activists have already mocked up posters of his face in the style of John Major: “What does the Conservative Party offer a working-class kid from Rochdale? They made him Home Secretary.”) If Javid chooses to run, he will face either Gove or a candidate with Gove as their de facto deputy and éminence grise. That could be Jeremy Hunt, whom May only kept in office after she became leader in 2016 because her preferred health secretary, Crabb, fell foul of a sex scandal.

None of Javid, Gove or Hunt would continue May’s attempt to take Conservative economic policy in a more statist direction – a bid that never made it out of the pages of a few essays on “Mayism” and on to the statute books. Her flagship education policy – the return of grammar schools – is dead in this parliament but retains enough affection within the Tory party that it might yet outlive her. Her only significant legislative achievement – that 2016 Immigration Act – might not even make it to the end of her premiership. As for Brexit, if her preferred outcome ends up being delivered, it will be because of the weakness of pro-European Tories on the back benches. Her failure to win a majority at the 2017 election guarantees that her chances of doing anything truly radical in this parliament are slim.

Why does she keep going? May knows that there are no prizes in politics for mere survival. Her MPs fear Gavin Barwell has convinced May that if she can survive until 2022, she might get another opportunity to contest an election and to write a better epitaph for herself. Thanks to Rudd’s demise, the influential Cameroon tendency have no obvious standard-bearer in the next leadership contest and therefore no vested interest in triggering one too soon. Although the Conservative Party has a historical reputation for ruthlessness, it can always find reasons for doing nothing.