Labour's Ed Miliband in Birmingham, where the Labour party made significant gains. Photograph: Rui Vieira/PA

The smiles were Boris Johnson's, but the greatest relief belonged to Ed Miliband. With the London result dramatic, but easily written off as a special case – thanks to the peculiar chemistry of two opposing personalities, one more popular than his party, the other much less – Miliband and Labour could celebrate having passed what US politics would call a threshold test, clearing a hurdle essential if Labour is, once again, to be a plausible contender for government.

The party did not shatter records or vastly exceed expectations. But it won in southern England as well as in the east, the Midlands and the north. Labour got the blood pumping again in its Welsh heartlands and staved off what would have been a disastrous defeat to the Scottish Nationalists in Glasgow. Taken together, these did not herald a party set to storm Downing Street: Labour won about 38% of the popular vote, still short of the magic 40% deemed indicative of general election victory, and way off the 43% Tony Blair recorded in local polls in 1996. But if the gains were not sufficient – as Miliband himself put it, Labour still has "work to do" – they are certainly necessary.

For they offer reassurance on multiple counts, a reassurance that even the grinning blond of London's City Hall could not spoil. It starts with the fear of what might be called Bradford West syndrome. There were some Labour high-ups who worried that George Galloway's upset byelection victory in March might presage a new era in which antagonism towards the coalition was plentiful, but found other outlets besides Labour. The nationalists were the most obvious alternative in Scotland, but Ukip, Respect, assorted local independents and even the BNP were all held to threaten Labour's franchise on opposition in England.

As Thursday turned into Friday, that fear receded. True, Ukip notched up a serious 12% of the popular vote and Galloway's party made respectable inroads in Bradford itself. But the larger story was that Labour ensured most of the anti-coalition vote remained its own. (As for the BNP, it collapsed, losing every seat it held.)

One Conservative-leaning strategist reckons Labour's achievement was modest – reaching a level they should have reached a year ago – but that it will still be enough to secure Miliband's leadership until the next general election. It certainly buys him the rest of 2012. On Sunday he is likely to see another centre-left leader, once also widely mocked as a no-hoper, anointed as president of France. Those conservative commentators who once laughingly talked of establishing a Don't Underestimate Ed Miliband Association might consider reviving their plan.

Besides London, David Cameron will struggle to spot shafts of light in the gloom. His party suffered deep losses. In the Liverpool mayoral election, the Tory candidate came seventh – rendering forlorn the fond Cameroonian hope of a revival in the northern cities.

Even the London result, when it finally came, offered slim consolation. It was clearly sui generis, thanks to a Labour candidate, in Ken Livingstone, so saddled with decades-old baggage he was unable to deliver the entire Labour vote in what is now, as the assembly results proved, a Labour city. But it has also entrenched Boris Johnson as the PM's most potent rival, with a base from which he can launch a future challenge.

But the one comfort available to the prime minister is also the most important. He has a resource denied those world leaders who have been punished for imposing austerity in the midst of recession: time. While Nicolas Sarkozy faces the voters on Sunday, Cameron's date with the electorate is three years away. He will hope that in the interim he will see the economy improve, the government get its act together and the serial shambles of spring 2012 become a distant memory.

Still, he now knows one prior asset has diminished in value. Last year Tory support held up, a sign that voters accepted his insistence that the government was clearing up a mess inherited from Labour and that it was spreading the economic pain evenly. Patience with that argument is wearing thin. It is Cameron's recession now and, thanks to the abolition of the 50p rate, not many still believe "we are all in it together".

In the meantime, the PM has to fend off nervous colleagues who, alarmed by Ukip, are already advocating a shift rightward. One Tory backbencher confessed he was "gagging" for some traditional Conservative red meat. Cameron will have to do his best not to reveal his exasperation as he explains that when a party loses votes to its left, it is potty to move right.

Not that he could make that move even if he wanted to. He is in a coalition. Which brings us to the Liberal Democrats, who did as badly this time as when they were battered, beaten and left for dead a year ago. Having lost 700 councillors in 2011, they lost an extra 300-plus on Friday, leaving them with fewer councillors now than at any point since their merged party was formed. Their base in local government, the key to Liberal survival over the decades, is eroding fast. They are a starving man living on his reserves of fat; soon the hunger will eat into the muscle.

The same could be said of British politics itself. The latest attempt at improving engagement was rebuffed: only one city, Bristol, opted to install a directly elected mayor, the rest said no. And ponder on this number: two in three of those who were eligible did not vote at all.