When the BBC broadcast The Experiment in May 2002, we did not realise how immediately relevant it would become. We did not know the nature of tyranny and abuse would, thanks to the scandal of the Abu Ghraib prison in Iraq, become one of the defining issues of western foreign policy.

In the TV series, a team led by the psychologists Alex Haslam and Stephen Reicher - the former the professor of psychology at Exeter University, the latter the same at St Andrews - put a group of volunteers in a simulated prison environment. The group was divided into guards and inmates to see how their roles would develop.

The aim was to test what had become received thinking on the subject, as formulated by the famous Stanford prison experiment, run by Philip Zimbardo at Stanford University in California in 1971. Zimbardo's conclusion was pure Shawshank Redemption: give a man a uniform, a truncheon, and power over a fellow human being, and you create a bully, a tyrant, a sadist. It's the "situation". It's human nature.

But Haslam and Reicher's work contradicted Zimbardo. He retorted that The Experiment was less science than reality TV, but the British pair's work has now crossed back into academia, with the full results of their experiment appearing this autumn in a range of psychology journals.

So, is torture or abuse, in places such as Abu Ghraib, bound to happen?

"The simple answer is no," replies Haslam. "One of the big problems in social psychology is that there have been theories - Zimbardo's is the best known - which have naturalised abuse and oppression. They have made them seem normal and the manifestation of some basic human drive. Zimbardo argues that his guards behaved brutally because of a natural tendency - 'natural' was his term. It's situational determinism. It must happen."

Haslam and Reicher disagree. Situation, they say, need not generate misconduct or brutality. "It would be foolish to argue that situation has no effect," Haslam says. "But what you see in our study is that sometimes people do things you don't expect. They say: 'No, we're not going to go along with that.' The other flaw in Zimbardo's analysis is that it doesn't explain how people resile from oppressive situations and overthrow tyranny."

How, in Haslam and Reichert's analysis, do events such as Abu Ghraib come about?

"First, it's not just a question of human psychology. It's also a question of politics. Second, you have to see what happened at Abu Ghraib as a group process rather than being perpetrated by individual psychopaths. This is essentially a manifestation of one group's way of thinking about another group. You can't understand those guards' behaviour without looking at the ways in which that relationship has evolved and been represented - the way in which, for example, Iraqis are routinely talked about as vermin or evildoers. Dehumanisation sanctions treating them brutally. The third consideration is leadership and followership. It comes down to the forms of action which are tacitly or overtly approved of by leaders. It's not the case that situations like Abu Ghraib naturally go toxic. You can look at other situations where people have behaved with compassion towards those in their power. For example, it's not the case that in the second world war all PoWs were abused by their captors."

I would suspect that every Russian prisoner of the Germans was.

"Exactly," Haslam says, seizing on the point as confirmation. "The Germans treated their captives differently as a consequence of different intergroup relationships. British captives were regarded as equal, not subhumans like the Slavs. That the Germans could behave barbarically towards some groups, and in a civilised way to others, demonstrates that abuse is not situationally inevitable."

So, to change the topic slightly, the abuse of children by Catholic priests isn't something that necessarily happens in a small, but predictable, number of cases?

"No. And I think that's a very dangerous view. It just excuses people - they say, 'What else can I do? You gave me the uniform, or the vestments, and of course I abuse them.' It negates accountability. The critical point that emerged from The Experiment was that people are capable of reflecting before acting. In our study it's very clear the guards spent a lot of time discussing their actions. Something else that emerged was that if you change the conditions in particular ways, then behaviour will be quite different."

How, then, do you change the conditions? "First, you can look at the facts on the ground. For every example of tyranny, for instance, you'll also find an example of resistance. Similarly, wherever there is oppression you'll find people who fight oppression. You can identify the structures that facilitate that. And you can think about the forms of accountability that foster the right kind of resistance.

"In The Experiment, the guards were aware of being observed, by other people, the 'audience'. So they had some sense of how their behaviour might appear to outsiders. But if you think about Corporal Grainer, or Lynndie England, when they were being photographed with their thumbs up, over abused prisoners, they visualised an in-group-approving audience that approved of what they were doing. You can say that they were mistaken. But that's what they thought. They also apparently thought the people who were supervising them also approved of what they were doing."

Supposing you were the general who was in charge of Abu Ghraib, or Guantánamo Bay, how would you have done it, or do it, differently?

"I don't think it's just a case of merely injecting an individual leader. If you look at our study, there were four phases. In the second phase, when there was quite a lot of conflict between the guards and the prisoners, we introduced someone who was a senior trades-union negotiator. What he did was to set in place democratic structures. The mechanics were very complex. But the point is that he was able to take a situation which was on the brink of breakdown and revolt, and turn it into one of order. The important thing is to get away from that very nihilistic fatalism and the 'apologism' of psychologists like Zimbardo. Because if you look at Abu Ghraib and say, 'that's what people do', you apologise for the inexcusable".