An extract from David Cameron’s official biography by Andrew Nero.

The electoral facts place David Cameron in the mid-range of Conservative leaders: fought two, drew one, lost one.  He was thus more successful than Michael Howard, William Hague and Iain Duncan Smith, his three immediate predecessors in the post – the first two of whom lost the only general elections they fought and the last of whom never fought one at all.  Cameron also out-performed Sir Alex Douglas-Home, who lost the only General Election he contested, that of 1964.

Edward Heath and Winston Churchill won one election each, an achievement that eluded Cameron.  However, Heath lost three and Churchill two, so on one measure they performed worse than he did.  John Major won one and lost one, Eden and Macmillan won one each and lost none, and Margaret Thatcher, the most electorally dominant Conservative leader in history, won three and lost none.

By one count, however, Cameron did better than any of them.  By making 96 gains in 2010, he achieved the best Tory result since 1931 – “or, if you consider the extraordinary circumstances of that year, the best Conservative result ever”, in the words of Michael Ashcroft in Minority Verdict, his study of the 2010 poll.  And it is worth noting, in the light of subsequent events, that Cameron won an absolute majority in England – one of 61 seats.

Admittedly, the Tories were starting from a very low base in that year (arguably, an artificially low one).  But whatever your view, this electoral achievement should be weighed in the balance. So much for dry statistics-crunching.  What of success or failure as a Party leader and Prime Minister – measures less easily taken?

The consensus view is that Cameron was rather a bad Party leader.  An unhappy thread runs through the tapestry of his leadership – the A-list, the grammar schools debacle, the handling of “Expenses”, the attempt to abolish the ’22, the effective whipping of the same-sex marriage vote, and so on.  One can argue the merits of his actions back and forth, but one strategic fact shines out: Cameron alienated his Right, much of which left for UKIP. In this sense, he was the Robert Peel of his generation.

Had the Conservatives not lost more voters to Nigel Farage’s party than Labour did after 2010, Cameron would probably have squeezed home with a sustainable chance of forming a government in 2015.  The Tories needed a Bolton West conservatism in 2015, but memories of Notting Hill conservatism were long years later. They cost Cameron dear.

Australian Liberals and New Zealand Nationals, Canadian Conservatives and Germany Christian Democrats – all had looked on in bafflement while Cameron lost part of his base: a schoolboy error unknown to centre-right leaders elsewhere.  There is a case for saying that this is a harsh judgement.  Centre-right politics, like centre-left politics, was fracturing in Britain.  Cameron was weighed down in 2010 by the legacy of his predecessors. This left him in coalition and with diminished authority.

But if Cameron was indeed a rather a bad party leader, he was also rather a good Prime Minister. Indeed, he can justly claim to have run one of the most successful governments in modern times.  This is not to suggest any great strategic consistency: over time, the Heir to Blair morphed into the Voice of Lynton. There was no “invitation to join the Government of Britain” in the Tory Manifesto of 2015.

Certainly, there were failures – the most attention-seizing of which was the unfulfilled pledge to reduce net immigration: a hazardous pledge from the start, given its very nature (since government can control what comes in, but not what goes out, at least in a free society).  Britain was slow to rebuild its energy capacity.  The Libya experiment failed and the Syrian vote was lost: Cameron was a foreign policy loser.

On Scotland, he was slow to grasp the culture shift that saw Scottish nationalism on the rampage: but, then again, so was nearly everyone else.  And on Europe, his Party led him, rather than contrariwise.  (There is a strong case for concluding that he had no choice, given the obsession of a large slice of it with the subject, but to be a Tory Harold Wilson.)

But no Government’s story is simply a roll-call of successes: after all, Mrs Thatcher’s governments didn’t get round to serious public service reform until her third term, the best part of eight years after she took office.  By contrast, the range and depth of the Grown-Up Government that Cameron led makes the years 2010-2015 look, in retrospect, like a Golden Age – as he and George Osborne utilised one of the most harmonious Prime Minister-Chancellor partnerships in history.

Osborne didn’t end the structural deficit, but he did deliver the public spending scalebook that he promised.  Labour had predicted continuing recession, soaring unemployment, riots on the streets.  Instead, they were confounded as  the economy grew faster than any other in the G7 and more jobs were created than in the rest of Europe put together.

Meanwhile, a generation of heavyweight Ministers channeled their energies into improving public services.  Michael Gove’s academies, exam reforms, and free schools helped to spread opportunity to a new generation of children.  Iain Duncan Smith’s welfare changes played a big part in ushering in Britain’s jobs miracle.  Theresa May saw through Police Commissioners, policing reform, and an end to stop and search.  Francis Maude scrapped and merged quangos as he overhauled the civil service.

In retrospect, HS2 was not a good idea – but, like Osborne’s nuclear deal with China, it showed that the Cameron Government wouldn’t simply duck big infrastructure decisions.  The Chancellor’s most important legacy was perhaps his Northern Powerhouse plan, demonstrated at its most far-reaching by the devolution of NHS and social service decision-making to Manchester.

All this public service reform, carried out against a background of one of the biggest public spending squeezes since World War Two, saw satisfaction rates with government rise rather than fall – even among consumers of the National Health Service, which had seen Andrew Lansley’s health reform bill fall victim to power play within the Coalition.  Many of its other frenziedly-hyped rows turned out to have more public than private resonance.

On deficit reduction, taking poorer people out of tax and the pupil premium, the two parties worked harmoniously enough together.  By the end of the Parliament, Conservative activists were showing  new levels of satisfaction with their Coalition partners, and a wistful appreciation of the benefits that joint government had delivered.

Cameron, of course, saw off the Liberal Democrats over the alternative vote, just as he saw off the SNP over independence.  In this respect, he was a lucky Prime Minister – winning two of his three referendums and, as we now know, not contesting the third (given the 2015 result).  The voting system wasn’t altered and Scotland wasn’t lost on his watch.  Though loathed by the conservative end of UKIP, he remained more popular than his party to the end.

Indeed, his standing has only risen since he left Downing Street.  The poise of Cameron’s response to the Bloody Sunday enquiry, his grasp of the dangers of Islamist extremism and refusal to be pushed around on the Middle East, his rejection of panic measures after the Cumbria shootings and the London riots…his coolness under fire has evoked, since, more than a little nostalgia.

In 2015, voters had been bruised by the long recession and their living standards had been squeezed.  None the less, they had got used to the council tax and fuel freezes, the growth in jobs, the serious-minded reform, the relative political stability.  Ed Miliband as Prime Minister, and what followed, turned out to be a shock that many of those who voted for him somehow failed to foresee.

As Iain Martin, the present editor of the Times, forecast, Cameron has morphed into an extremely popular former Prime Minister.  Martin wrote that he would “buy a lovely house in Oxfordshire, start shooting and hunting again, drink some nice claret, do some very light international work on foreign aid, take on charity work in the Big Society vein, beam with pride about Sam Cam becoming a fashion industry entrepreneur in her own right and occasionally pop up on the Marr show”.

All this has indeed come to pass.  But as Cameron fades into the past and a second independence referendum looms, the historian can only write: it didn’t have to be like this.  There are no inevitabilities in history.  If a few thousand votes that were cast otherwise on May 7, 2015 had only been blue, the end of this story might have been very different…