In the many accounts of how Ed Miliband lost the general election, and David Cameron won it, one factor never receives the attention it deserves.

For the British press only parts with the utmost reluctance from its stereotypical descriptions of Conservative politicians.

Many years after Tory women gave up wearing hats, photographers covering the party conference were still instructed to take pictures of them wearing hats.

And in any account of Cameron’s early life, one can be confident that the words “Eton” and “Bullingdon Club” will be found, often accompanied by a picture of the latter.

One can also be pretty sure the Conservative Research Department (CRD) will not be mentioned in more than a cursory fashion. Had its members dressed up as footmen, been photographed in that uniform, and every so often smashed up a restaurant, they would have attained greater prominence, for they would have conformed to the loutish upper-class stereotype which so entrances middle-class editors.

But CRD was less interesting than that. It was merely the institution where, on joining in 1988 straight from university, Cameron learned the method of doing politics which contributed directly to the victory of 2015.

He was an apt pupil, whose political gifts might well have flowered without an apprenticeship in CRD. But it is pretty much inconceivable that he would have assembled the same team: members or former members who have benefitted from a CRD training include Ed Llewellyn, Oliver Letwin, Steve Hilton, Rachel Whetstone, Catherine Fall, Jonathan Hill, John Whittingdale and, from a slightly later period, George Osborne.

That list is very far from exhaustive. This is a CRD government. And that means, among other things, that Cameron’s team possesses, on the whole, a greater professionalism than Miliband’s team, a number of whom were formed by their membership of Gordon Brown’s entourage, in which they learned how to do down rivals.

I do not want to wreck a strong case by overstating it. But in 1983-84, I happened to have a brief spell in CRD, and saw what a useful training it offered to those with the ability and ambition to take advantage of it.

The task of CRD in the 1980s was not research understood in any academic sense. The department existed to put the best possible construction (short of outright falsehood) on whatever the Conservative Government was doing, and the worst possible construction (short of outright falsehood) on whatever Labour was saying.

This is not a very elevated activity. But as a training in practical politics, it is invaluable. It demands brainpower, ingenuity, energy, an acute feel for politics, and the ability to express one’s findings in clear English.

Unless some group of people is providing this service, party politics cannot work. No individual candidate or MP can be expected to know about every aspect of policy, let alone to work things out from first principles.

Even if one decides to dissent from the party line on pensions, or local government finance, or planning, or cruelty to animals, or immigration, or South Africa, or counter-terrorism, one wants first to know what that line is, and what arguments are being used to justify it.

And then the candidate or MP wants to know, as required and perhaps at very short notice, what the Opposition thinks about these things. One cannot possibly find the time to do all this for oneself.

The point of CRD was to provide this information. It would also brief ministers who were about to go on programmes such as Question Time, then enjoying its first and brightest flowering under Sir Robin Day.

By watching it carefully for a month or two, one could work out what subjects were going to appeal to it in any given week, after which one could check what the Conservatives had to say about these, and what the Opposition was saying about them.

Particular, indeed excessive, delight was taken in discovering any contradictions between what the party’s opponents had said. Embarrassingly inconsistent quotes by Opposition figures were used over and over again, long after one might have thought they had gone out of date.

Today one still finds Cameron revelling in such discrepancies at PMQs. He does not despise the methods of his youth. In order to amass this ammunition, one not only listened to or read everything the Opposition said, and went through the newspapers (for which CRD in those days had an in-house cuttings service). One also subscribed to every loony Left organisation one could think of, in the hope that it would put disreputable material in the post.

Although the department had some senior figures, who knew how things should be done, it also employed, on low salaries, bright graduates who were interested in politics but needed to learn almost everything. As Cameron himself has written (in Tory Policy-Making: The Conservative Research Department 1929-2009, a volume edited by Alistair Cooke – now Lord Lexden – to mark the 80th anniversary of the founding of the department):

One of the best things about CRD is that it puts fresh-faced graduates at the side of senior members of the Party within moments of their arrival. At twenty-one, I found myself briefing Trade, Industry and Energy Ministers, almost from the first day, as well as the MPs who attended the specialist backbench committees covering those subjects. And they were easier to get on with than you would think. DTI morning meetings were always interesting, with Ministers taking it in turns to have a go at each other. “My constituents are furious with the Government,” said one. “Serves you right for going to your constituency,” replied Alan Clark.

There was an exhilarating unexpectedness about finding oneself operating at this level. But there was also unlimited scope for making a fool of oneself if one did not know one’s stuff. As Cameron recalls:

Of course, during my time at CRD the most senior figure of all was Mrs Thatcher. I’ll never forget my first meeting with her. Walking around at an office party, she stopped in front of me and asked: “What are the trade figures? Have you seen the trade figures today?” I had not. She had. I never made the same mistake again.

Good briefing cannot be faked. Incompetence is bound very quickly to be detected, for either you know what you are talking about or you do not.

CRD was in some ways an astonishingly louche institution. But it was also a place where the ability to do things well was quickly noted. Very soon Cameron was briefing Thatcher’s successor, John Major, before PMQs, and during the unexpectedly victorious 1992 general election campaign.

The relevance of this to the present day is not just that the Tories have won another unexpected victory. Cameron at a young age mastered some of the essential techniques of politics, and learned to value that mastery in others, notably Osborne, Letwin and Llewellyn.

Technique is not everything. It may leave you with an inadequate sense of direction: one of the Tories’ weaknesses during the 2010 election campaign.

No one has described this risk better than Raymond Chandler, though he had writing rather than politics in mind:

Everything a writer learns about the art or craft of fiction takes just a little away from his need or desire to write at all. In the end he knows all the tricks and has nothing to say.

But people still, on the whole, prefer a competent government, or indeed writer, to an incompetent one. And Cameron from 2010-15 organised a competent government, in which surprisingly few things went wrong, at least by comparison with the huge number of things that could have gone wrong.

The press, which loves nothing better than a gaffe, had to make what it could of the omnishambles Budget. It also had Andrew Lansley, who was at one time Director of CRD. But Lansley had spent his formative years in the civil service, and his faults were those of an official with an inadequate sense of how his reforms would be received.

The voters were quietly impressed by Cameron’s competence. They reckoned he was much less likely than Miliband to embarrass them. And one of the places where Cameron had learned how to be a competent politician was the CRD.

Here is my dreary conclusion. The Conservative Party long ago realised that to have any chance of success, it had to become more professional than its rivals.

That was why in 1929 Neville Chamberlain persuaded Stanley Baldwin to set up CRD.The Tories were going to show they had better policies than Labour to alleviate poverty: a project which Chamberlain, once he succeeded Baldwin, was determined not to see destroyed by a world war.

After the world war broke out anyhow, Rab Butler used CRD – staffed by such brilliant figures as Reggie Maudling, Iain Macleod and Enoch Powell – to get the Conservatives back in a game whose rules had been rewritten by Labour.

And now we have a CRD Prime Minister, who has shown that the Conservatives are more competent than Labour. It is a dull enough boast, and the press will continue to hanker after more interesting things to write about.