Why is it, James Robertson wonders, that Scottish authors have been so drawn to the themes of hidden agendas and double lives?

Robert Louis Stevenson wrote about this. Later, so did John Buchan. Later still, so did crime writer Frederic Lindsay - and Robertson himself.

These themes do seem to have a timeless fascination. They are not, of course, confined to Scots-born writers; but there is something in them that has plainly appealed to writers for a very long time.

The reason all of this has come up now is that Robertson, one of our most gifted and garlanded novelists, is giving an intriguing talk on this very subject next Friday. It has the fitting title of The Blanket of the Dark.

"Is this peculiarly Scottish or not?" he asks. "I don't think we're any more susceptible to leading double lives than anybody else in the world. Nevertheless, it is a theme that runs through quite a lot of our literature.You can even see it in James Hogg. It does seem to crop up time and again."

The Blanket of the Dark will be one of the highlights of Edinburgh University's literary Spy Week. The programme, which starts on Monday, will feature screenings of classic spy films, talks by spy-fiction writers, and a discussion of the work of Graham Greene, a one-time MI6 agent.

Scholars will also examine the place of secrecy in our social lives, and the role of fiction during and after the Cold War. Scots-born spy novelist Charles Cumming will be among those taking part.

Not that Robertson is a voracious consumer of spy fiction. "I couldn't say it's an enduring love that has eaten me up for years," he acknowledges, "but what I really enjoy is reading spy fiction which is well-written and makes you think of the bigger issues around it.

"For me, John le Carre is the absolute peak in those terms. He's not only a brilliant writer but he also gets under the skin of what spying, and associated activity, is all about. For anybody who likes reading and wants a book in which there is intrigue and double-dealing and things not being quite what they seem, and which provokes thought about how societies operate and how states defend themselves and attack others - spy fiction is a great genre."

His talk will survey some of the themes he has picked up on in some areas of fiction coming out of Scotland. Buchan, for one - the Oxford-educated classicist who would become Lord Tweedsmuir, and governor-general of Canada. And, in Robertson's considered judgment, a "misunderstood but very good writer".

"He often describes worlds where there is something going on on the surface and something else going on underneath. He does it in his historical novels but also in what he was in the habit of calling his 'shockers' like The 39 Steps and The Power-House."

The latter is particularly interesting, he adds. A very short book, it was serialised in 1913 and published in book form three years later, when the Great War was at its height.

"It's a spy story but something more than that. He's questioning the idea of civilisation, what it is and what it is held together by.

"His villain says the difference between civilisation and barbarism is nothing, it can turn in a moment. It's a 'sheet of glass', is how he describes it.

"On Friday I'll be looking at some of the novels that have explored these double worlds but I've gone back even further, to a writer who was a big influence on Buchan."

Step forward Robert Louis Stevenson. "Jekyll and Hyde is the absolute prototype for books about double-dealing, about people leading one life on the surface but another one when night falls."

This is a theme that has appealed to Robertson himself over the years, and which he has explored in novels such as his "beautifully plangent" (so ran The Herald's accolade) work from 2013, The Professor of Truth.

"That was based on the Lockerbie disaster but I wanted to try to distance it from the real event and look at some of the bigger issues that always attach to major stories like that. One of the things I found fascinating about Lockerbie is how there's a narrative that has been officially presented through the investigation and the trial. Increasingly, people have questioned whether that is a valid narrative. Purely as a writer, because that's what I do, I'm interested in the whole question of narratives and how they become fixed, or distorted, and how they are challenged. In my big novel about Scottish politics, And the Land Lay Still, there is a subterranean dimension as well as a surface one."

What is the motivation for writers to look at these themes in their novels? In Robertson's view, it's the compulsion to look at how the real world works; sometimes the most effective way of doing so is by telling a story that fictionalises it. A thought strikes him. "I don't know if you remember a novel by Frederic Lindsay, called Brond. It came out in 1983: it's a really fantastic novel but also a very tricky one, difficult to get your head around. It's very opaque, you're never quite sure what is going on.

"Most of us just get on with our lives and don't really think anything else is going on under the surface. But Lindsay was writing this at the height of the Troubles in Northern Ireland, and he was making the point that should anything similar begin to happen in Scotland at the time, the security services would deal with it in precisely the same way. When you start lifting the stones, as it were, you start to find all sorts of interesting things going on under the surface. That's what Lindsay was doing in Brond. He said that he wrote it as a corrective to Douglas Hurd's novel, Scotch on the Rocks, a fictional take on potential scenarios north of the border. Brond was Lindsay's way of saying, there's another way of looking at this."

We return to the issue of double lives and whether it's in some way a distinctively Scottish thing. In literary terms, at least.

"To be frank, I'm not absolutely sure. I'm always wary when people say, 'That's a definite Scottish characteristic': I always think that's a dangerous thing to do, to ascribe a characteristic to an entire population. Nevertheless, the double life is something that recurs quite a lot in our literature.

Maybe, in part, that's a reflection of the slightly unusual position that Scotland has inhabited politically and culturally for a long time, that it's a nation yet not a nation-state.

"I suspect that that has something to do with it. It's also maybe why, when we do look at some of these matters, we find all kinds of interesting contradictions: a certain amount of complacency on the surface and a certain amount of paranoia underneath."

The Blanket of the Dark: Truth and Lies in Real and Imagined Scotland; Informatics Forum, Edinburgh University, Friday, 5.30pm. Website: http://www.spyweek.llc.ed.ac.uk