FEW countries have dominated any industry as Britain has dominated the industry of producing fictional spies. Britain invented the spy novel with Rudyard Kipling’s dissection of the Great Game in “Kim” and John Buchan’s adventure stories. It consolidated its lead with Somerset Maugham’s Ashenden stories and Graham Greene’s invention of “Greeneland”. It then produced the world’s two most famous spooks: James Bond, the dashing womaniser, and George Smiley, the cerebral cuckold, who reappears this week in a new book.

What accounts for this success? One reason is the revolving door between the secret establishment and the literary establishment. Some of the lions of British literature worked as spies. Maugham was sent to Switzerland to spy for Britain under cover of pursuing his career as a writer. Greene worked for the intelligence services. Both Ian Fleming, the creator of Bond, and John le Carré, the creator of Smiley, earned their living as spies. Dame Stella Rimington, head of MI5 in 1992-96, has taken to writing spy novels in retirement. It is as if the secret services are not so much arms of the state as creative-writing schools.

Another reason is that British reality has often been stranger than fiction. The story of the “Cambridge spies”—Kim Philby, Anthony Blunt, Guy Burgess and the rest—is as far-fetched as it gets. One Soviet mole at the top of MI6 (Philby, who also worked for The Economist in Beirut); another even looking after the queen’s pictures (Blunt); a cover-up; a dash to the safety of the Soviet Union; larger-than-life characters such as the compulsively promiscuous and permanently sozzled Burgess.

There is also a more profound reason for Britain’s success. The spy novel is the quintessential British fictional form in the same way that the Western is quintessentially American. Britain’s best spy novelists are so good precisely because they use the genre to explore what it is that makes Britain British: the obsession with secrecy, the nature of the establishment, the agonies of imperial decline and the complicated tug of patriotism.

Britain is honeycombed with secretive institutions, particularly public schools and Oxbridge colleges, which have their own private languages. At Eton, for example, where Fleming was educated and Mr le Carré taught for a while, boys dress in tailcoats and call their teachers “beaks” and their terms “halves”. Walter Bagehot argued (approvingly) that Britain weaves duplicity into its statecraft. The constitution rests on a distinction between an “efficient” branch which governs behind the scenes, and a “dignified” branch which puts on a show for the people.

The British habitually wear masks to conceal their true selves. They put on different costumes for different roles in Bagehot’s theatre of state, and keep stiff upper lips to conceal their emotions. Mr le Carré (whose real name is David Cornwell) learned to put on a brave face at school because he was so embarrassed by his father, who was a professional confidence trickster. Greene learned the spymaster’s art when, as a pupil at Berkhamsted School, he acted as an informer for his father, the headmaster.

The British establishment is not only a perfect machine for producing secrets and lies. It also produces the mavericks and misfits who thrive in the secret world. Establishment types seem to come in two varieties: smooth conformists who do everything by the rules, and mavericks who break every rule but are nevertheless tolerated because they are members of the club. The first type is sent into the Foreign Office and the second into MI6. The best spy novels are like distorting mirrors in fairgrounds: by exaggerating this or that feature of Establishment Man, they allow the reader to understand the ideal form.

The other great theme in British spy novels is geopolitical decline. How can people who were “trained to Empire, trained to rule the waves”, as one of Mr le Carré’s characters puts it, bear to live in a world in which the waves are ruled by other powers and statecraft is reduced to providing fuel for the welfare state? Fleming’s novels are full of laments about Britain’s “crumbling empire” and its dependency-producing state. “You have not only lost a great empire,” Tiger Tanaka, a Japanese spy, tells Bond, “you have seemed almost anxious to throw it away with both hands.” Mr le Carré once described Britain as a country where “failed socialism is being replaced by failed capitalism”. The Circus, as he called the secret service’s headquarters, is a physical manifestation of decline: cramped, shoddy, reeking of rising damp, just one hasty repair away from collapse.

Nobody does it better

Why remain loyal to a country that has made such a mess of things and to an establishment soaked in hypocrisy? Mr le Carré’s traitors (like the Cambridge spies who inspired them) betray their country not for money but because they have transferred their patriotism to the Soviet Union. But what makes Britain’s best spy novels so good is that they toy with disillusionment only to reject it. For all its faults, they say, Britain is the best of a bad lot. Bond is so besotted with his country that he boasts that “British food is the best in the world”. For all his professed Europeanness in the new novel, Smiley is the model of a British gentleman.

And spying provides Britain with a way of reclaiming its greatness, by excelling in the most sophisticated form of foreign policy. The Americans have the money and the bluster, but the British have the brains to spend it wisely and restrain the Americans from going over the top. Felix Leiter, Bond’s opposite number in the CIA, admits that Bond is playing “in a bigger league” than he is. Smiley is more subtle than his “cousins” in America. The secret at the heart of the British spy novel is that Britain is much better than it seems. The writers agonise over decline and hypocrisy, only to conclude that the British are cleverer and more civilised than anybody else. A comforting illusion wrapped in a tale of disillusionment: you can’t get more British than that.

Economist.com/blogs/bagehot