The class war was over, and the toffs had lost. In his magnificent biography of Harold Wilson, Ben Pimlott gives the date when the traditional ruling class surrendered: 22 July 1965, when Sir Alec Douglas-Home resigned as leader of the Tory party.

On hearing the news, Wilson performed a victory jig round the cabinet table while singing There Will Never Be Another You. Wilson had led Labour to a narrow win at the general election of October 1964, and Douglas-Home's departure appeared to set the seal on the social revolution that had occurred in British politics.

Pimlott himself, writing in 1992, was in no doubt that the change was permanent: "An era had finally ended. Sir Alec Douglas-Home was the fourth Conservative leader in succession either to have been drawn from, or to have married into, the aristocracy. Since his departure, with the single exception of Michael Foot, there has been no leader of a major British party who even attended an independent school."

To beat Wilson, the Tories turned to Edward Heath, the most "common" leader they had ever had, and the first to be elected by Conservative MPs rather than chosen by a mysterious "magic circle" of grandees. No longer would the Etonians be running the show and choosing one of their own as front man. It seemed clear that no one from one of the old public schools would ever again lead the Tories. The future belonged to people such as Heath, who could be presented as classless meritocrats, and whose rise dramatised a radical social shift. The irony was that, despite his humble origins, he lacked the common touch. Relatively humble origins had nevertheless become a necessary qualification for leading the Tory party: he was succeeded by Margaret Thatcher, John Major, William Hague, Iain Duncan Smith and Michael Howard, none of whom had been born with a silver spoon in his or her mouth.

In retrospect, the key defeat for the traditional ruling class could be said to have taken place as long ago as 1945, when the Tories under Winston Churchill, grandson of a duke, suffered a crushing defeat at the hands of Clement Attlee's thoroughly egalitarian Labour party.

Voters condemned the Tories as "upper-class, out of touch and uncompassionate – the party of two nations, not one", as Alistair Cooke, the Conservative party's official historian, has put it. The Tories were blamed for the dreadful unemployment of the 1930s, and after 1945 were forced to try to recover lost ground by accepting the NHS and economic policies that owed more to socialism than to the free market.

Harold Macmillan, the most successful postwar Tory prime minister until Thatcher, took enormous pains to make himself look "modern" and "progressive" – a side of him obscured in public memory by his grouse-moor image.

While serving as leader of the opposition, David Cameron hung a picture of Macmillan in his office. In class terms, Cameron's election as Tory leader in 2005 was an astonishing turn of events; the party was once more led by an Etonian who had married into the aristocracy.

Cameron has also striven to show how progressive he is. Under his leadership, the Tory party has made intense and partially successful efforts to recruit more women and ethnic minority MPs. It has also accepted what for most Tories is far more objectionable: coalition with the Liberal Democrats.

Unfortunately for the Tories, the Lib Dems are led by Nick Clegg, described by Boris Johnson as a "cut-price edition of David Cameron hastily knocked off by a Shanghai sweatshop to satisfy unexpected market demand". The coalition is top-heavy with public schoolboys. The class war did not after all end in July 1965, but is still raging in April 2012.

Andrew Gimson's Boris – The Rise of Boris Johnson is now out in paperback