Three months ago, on July 7, London suffered its 9/11. An attack on the capital had long been predicted and, mercifully, far fewer people were killed than in the Twin Towers. But that was no consolation in the chaos. The 52 innocent and unlucky dead, from a striking variety of faiths and backgrounds, left many more distraught friends and relatives, more than 700 injured, a city wounded and a nation in shock.

And then we learned that the bombers were "home-grown". That incongruous word, more often applied to talent, or vegetables, seemed completely at odds with the horror of that summer Thursday and what one bereaved father called its "totally evil" perpetrators. Bemused commentators cast about, desperate to understand how young British men - men such as Mohammad Sidique Khan, married with a job and a baby, living in one of the freest and most fortunate societies on earth - could come to turn their hate on their homeland, and blow themselves to pieces to express that hate.

Once we would have blamed the devil and called those four young suicides "possessed". But in 1950, when the United States confronted Mao Zedong's China in the Korean war, a chilling new word became available. That word, coined by the CIA man Edward Hunter, is "brainwashing". It is a propagandistic, rough-and-ready translation of what the Chinese Communist regime called szu-hsiang kai-tsao: a process of "thought reform" or "re-education". Thought reform was used in academies to make students into good communists and in prison camps to "cleanse" the "wrong thoughts" of political dissidents, foreign citizens and enemy soldiers. After undergoing thought reform, some Americans converted to communism and strongly denounced the US, a spectacle as unnerving to most Americans then as suicide bombers' video testaments are to us today.

Brainwashing threatens cherished notions of free will. It seems to suggest that we may not be safe anywhere, not even inside our own skulls. Since Korea it has been invoked whenever people do something especially incomprehensible. In 1974, the heiress and kidnap victim Patty Hearst joined her abductors in a murderous bank robbery. Four years later the followers of the preacher and paranoid socialist Jim Jones willingly drank sugar-flavoured cyanide. On each occasion, as after Waco, 9/11 and other atrocities, the concept of brainwashing re-emerged into popular consciousness. Sure enough, following 7/7, Khan's shattered family insisted that he must have been brainwashed. How else could a kind and loving man become a suicide bomber?

Say the word "brainwashing", and chances are we think of the Manchurian Candidate, of some mysterious process that installs malevolent new beliefs in people's minds - as if ideologies were just like versions of Windows. This horror-movie view of brainwashing is alarming, but also comforting. It scares us with one of the most frightening visions we can contemplate: the utter loss of free will as our minds are "turned" or "poisoned", our core identity subjugated to some evil-minded fanatic. But unlike its predecessor possession, brainwashing blames people, not demons. In doing so it offers reassurance, lifting the curse of moral responsibility from the bomber's shoulders - and, by extension, ours - and placing it firmly in Osama bin Laden's lap. Bin Laden is the evil genius with the power to control minds at will. We are the victims, gathering our resources to fight back.

But brains are not computers, and there is no Button X that Osama and his ilk can press to turn a man from good to evil. Giving a name to the pathway from "normal" to "killer" may make us feel better, but it doesn't help us prevent any future bombings. All it offers by way of solutions are the age-old reactions to evil: exorcism or destruction. Exorcism, needless to say, doesn't work on Islamist radicals. Destruction, given our ignorance of where to aim our weapons, runs a high risk of wiping out the wrong targets, as the family of Jean Charles de Menezes has learned.

What we need is not aggression but comprehension: not total evil but graspable human wickedness. We need to think of brainwashing more realistically: not as black magic but in secular, scientific terms, as a set of techniques that can act on a human brain to produce belief change. People do, in certain circumstances, undergo dramatic changes of belief over startlingly short periods of time. Sometimes the new beliefs are frankly bizarre. Sometimes they are lethal: when Jonestown imploded more than 900 people died. But the strangeness or moral repugnance of a belief is no bar to understanding how it can be stamped on a person's mind.

One striking fact about brainwashing is its consistency. Whether the context is a prisoner-of-war camp, a cult's headquarters or a radical mosque, five core techniques keep cropping up: isolation, control, uncertainty, repetition and emotional manipulation. To see how these work, let us imagine a situation in which Mr X, the leader of a small group of ideologues committed to violence, is attempting to brainwash a young man - let's call him Adam.

Mr X has an immediate problem: the message he wants Adam to believe goes against some of Adam's own beliefs, as well as contradicting many beliefs that Adam may not have thought much about, but which are widespread in British society. Adam may, for instance, have friends who Mr X thinks are immoral. Whenever Adam enjoys their company his belief that such friendships are acceptable is reinforced. To contradict that belief, Mr X first needs to weaken it by isolating Adam from his former friends. Indeed, his aim is to isolate Adam as far as possible from every enjoyable aspect of his former life. Jim Jones achieved isolation by physically moving himself and his followers to the Guyanan jungle. More recently, al-Qaida has sent British recruits to remote training camps. If total isolation is not possible, then Mr X will encourage Adam to strengthen his commitments to the group.

Along with isolation goes the second technique: control of what Adam sees, hears and thinks about. Like isolation, control squeezes Adam's mental horizons, narrowing his field of view so that everything becomes interpreted through the one ideological lens. Brains, even well-brought-up, adult brains, depend heavily on the information reaching them via their senses. Beliefs confirmed by that information are reinforced and grow stronger, while beliefs contradicted by it tend to weaken. Mr X will therefore aim to make sure, as far as he can, that Adam spends plenty of time with group members pondering the new ideology and contrasting it favourably with Adam's former beliefs. Adam's media consumption will also be regulated: fewer aspirational Hollywood fantasies and adverts promoting western consumer lifestyles; more about the west's selfish greed, its neglect of its own disadvantaged, and the atrocities that emerge whenever Europe or the US bungles foreign policy.

Adam, however, may still be quite attached to his former beliefs, in which case Mr X will need to challenge them directly. This is where uncertainty comes in, because uncertainty is a potent source of stress: ask any relative of a murder victim whose body cannot be found. If Mr X can make Adam doubt beliefs he used to take for granted, he will look for alternative certainties to replace them - and the brainwasher stands ready to assist, offering a simple, coherent, unified belief system. Mr X wants Adam to look to him for answers to every problem, so he will emphasise his authority and expertise. He will also claim that his ideology is a total system, capable of judging any issue and relevant to every walk of life. Not only does this make Mr X seem more powerful; it also helps stop Adam protecting favourite former beliefs by classifying them as beyond Mr X's ideological remit.

The contrast between the complicated, fragmented muddle of the unbeliever's life and the pure simplicity of true belief is often emphasised by ideologues who understand the power of uncertainty to frighten and unnerve people who may already feel that their lives are out of control. Sayyid Qutb, a founding father of radical Islamism, used the Islamic term jahiliyyah - literally, ignorance - to describe western existence, a word with connotations of darkness, complexity and moral chaos. Qutb's west is not so much the Great Satan as the Great Void: relativist, postmodern and meaningless. Mr X, wanting Adam to find certainty with him and his group, will trade on similar associations to demonise his opponents. By contrast, he will emphasise how clear and simple his basic rules are by making his core message brief, coherent and easy to understand and remember. Every ideology has its soundbites.

Mr X's fourth technique is repetition. The more often Adam hears the core message, the more comfortable and familiar it will feel to him and the more likely he is to take it on board. In Maoist China, thought-reform academies scheduled hours of lectures and discussion, from early in the morning to late at night, for days, weeks, months or even years on end. When not attending lectures, groups of students engaged in a process called "struggle": one person was accused of, or confessed to, having "wrong thoughts" or beliefs; then other group members showed their loyalty by competing to challenge and condemn the unfortunate victim and reiterate the communist message. Students also had to keep detailed, publicly available diaries of what they were thinking: lengthy confessions of thoughtcrime, in effect. Diaries, struggle groups, lectures, debates - and always the same message, hammering into the skull again and again, breaking down resistance.

Isolation, control, uncertainty and repetition will help Mr X and his group to damp down Adam's old beliefs and introduce his brain to new ones. But for the transplant to take, he will need the final weapon in a brainwasher's armoury: emotion. Until the late 20th century scientists largely ignored emotion; science has its fashions like everything else. In recent years, emotion has become a much hotter topic. For ideologues, however, understanding emotions has always been essential. They know, either instinctively or because they have studied their predecessors, that rational argument, though it may please a logician, is a weak tool for gaining followers - or whipping up a mob.

Adam may find Mr X's arguments convincing, but we all have beliefs we never act on. To act, we have to care. Mr X will try to stir up emotions in Adam that make him care: positive feelings when he talks about the new beliefs; negative ones whenever he thinks of old ideas. To do this, he uses the human brain's own power of association to manipulate it. Association allows us to link two brain events (be they perceptions, thoughts, or emotions) if they happen simultaneously. If a cat, for instance, is seen and heard at the same time, its image and meow become associated, so that next time we hear the sound we visualise the animal.

The brain's response to signals from hearing or vision is rapid and transient; when the meow stops, or something more interesting comes along, the person no longer hears the sound of meowing. This allows brains to keep up with a fast-changing world. Emotions, however, tend to linger, especially strongly negative emotions, because they have evolved as override signals triggered by the threat of danger. It didn't matter if your distant ancestor was still shaking 10 minutes later, as long as her reactions were quick enough to get her out of the predator's way in time.

But then human beings invented symbols, and symbolic thinking changes everything. Nowadays Mr X and his like can use symbols - words or images, the more shocking the better - to trigger extremely strong negative emotions in Adam. All Mr X needs to do is mention his enemy the west at the same time, and the association will form in Adam's brain, if it isn't there already. Likewise for positive emotions: when Mr X speaks of peace, love and brotherhood he will be sure to emphasise his group's beliefs as well.

Every human being needs emotional sustenance from others. Mr X will aim to ensure that he and his group become Adam's main or only source for these positive feelings. Kindness and concern, laughter, friendship and contentment will be constantly on offer from them; the rest of the universe will fade into a hateful darkness. As Adam becomes more dependent, it will be easier to raise the most challenging of issues: suicide bombing. Or, as Mr X will undoubtedly call it, sacrifice, for the good of Adam's now-beloved group.

If Mr X is adept at what he does, Adam will not pause to reject the twisted terrorist logic that says it's OK to kill D because D supports A, who sent in the soldiers who killed B, whom I care about. Adam will not care that D may not have voted for A; that B's death may be due to human error or military savagery, which A condemns; that D has no way of changing A's behaviour; or that Mr X's goals are completely unrealistic. Adam will not stop to ask the difficult questions or to remember the long list of radicals whose fire was doused, of necessity, once they gained power and realised just how muddled and compromised the real world is. Adam would certainly never admit that terrorism springs not so much from evil as from immaturity: the lazy or callous or desperate short-sightedness of people who, like an angry toddler, want their demands met, now, however stupid those demands may be. He may understand the terrorist's grievances, but he cannot see the multiple, competing strands of political opinion that so often leave western governments complicit or ethically inert. He will also fail to grasp that each atrocity loses Mr X more friends among those with the power to help his cause. Least of all can Adam bring himself to laugh, albeit angrily and with disgust, at Mr X's ludicrous determination to take himself seriously.

Brainwashed Adam is no longer able to think any of these thoughts. But we can, and that freedom gives us a great advantage over him: the ability to understand what makes Adam and others like him behave the way they do. Whether - and how well - we use that knowledge is up to us.

· Kathleen Taylor is the author of Brainwashing: The Science of Thought Control (OUP). To order a copy for £17.99 with free UK p&p, call 0870 836 0875