People with obsessive-compulsive disorder (OCD) struggle to overcome their repetitious urges due to an inability to learn what kinds of stimuli are actually safe, new research suggests.

OCD is a disorder where people feel compelled to repeatedly perform certain tasks or think particular thoughts. These insistent routines are called 'rituals', and scientists think the behaviours persist because those with OCD struggle to learn when situations aren't threatening.

"Our study suggests that something is going wrong in the brains of people with OCD when they are learning what is safe, and this in turn affects how they perceive threats under updated circumstances," says neuroscientist Annemieke Apergis-Schoute from the University of Cambridge in the UK.

Apergis-Schoute and her team conducted a learning experiment where they compared the brain activity and anxiety responses of OCD patients with measurements taken from people without the condition.

OCD is estimated to affect around 1 percent of the adult population in the US, with the disorder compelling people to do things like repeatedly wash their hands, or check that doors are locked and appliances are switched off.

"They're not usually off-the-wall bizarre," one of the team, Naomi Fineberg from the Hertfordshire Partnership University NHS Foundation Trust in the UK told New Scientist.

"The obsessions are the sorts of things that most people would understand as being rational but exaggerated – for example, the need to wash your hands after going to the toilet."

While these rituals aren't necessarily harmful in themselves, they stem from intrusive and unwanted feelings that are usually associated with anxiety, and can have a considerable impact on carrying out day-to-day activities.

One of the ways of treating OCD is called exposure therapy, where people with the condition are made to confront the source of their anxiety – such as touching a dirty object – in an attempt to control their response.

But exposure therapy doesn't work for every patient, and even in people who do learn to control their anxiety response, the effectiveness can be limited.

To find out why exposure therapy might only have limited success in treating OCD, the researchers recruited 78 people for a learning experiment – 43 of the volunteers had OCD, and 35 acted as a control group.

Each of the participants were asked to lie in a functional magnetic resonance imaging (fMRI) scanner, which measured their brain activity while they were shown one of two faces – a red face or a green face.

In the first experiment, the participants would receive a mild electric shock when shown the green face, but wouldn't be shocked when viewing the red.

Sensors that measured tiny amounts of sweat produced by the participants showed that the group learned to associate anxiety with the green face (as a result of the electric shocks that came with it), but not with the red face.

But then the researchers swapped the green and red faces around, so that it was the red face that now came with an electric shock.

While the control group successfully learned the new associations – green is now safe, red is bad – the participants with OCD were less able to register that the green face no longer posed a threat.

Measurements of the participants' brain activity when they were shown the now safe green face indicated that the OCD patients had less activity in the ventromedial prefrontal cortex – which is associated with processing safety signals in the brain, and decision making in relation to perceived risks.

According to the researchers, this could explain why people with OCD have difficulty overcoming their rituals, because their brains may find it significantly harder to unlearn negative associations, even when treatment such as exposure therapy attempts to directly counter them.

"This needs to be taken into consideration when we're developing future therapies to tackle the disorder," Apergis-Schoute explains in a press release.

"Current exposure therapies may help the patient take control over their compulsions, but our work suggests that they might never learn that their compulsions are unnecessary and they may return in times of stress."

It's worth pointing out that the researchers are drawing their conclusions from a very small sample of participants, so larger studies involving more patients affected by OCD will be needed to confirm the findings.

But if the results can be replicated, it could help explain some of the limitations of exposure therapy, and improve the delivery of the treatment in the future.

"The bit of their brain that should be telling them it's safe isn't working," Fineberg explained to Clare Wilson at New Scientist.

"Now we can say to them this is why [exposure therapy is] taking so long and we should stick with it."

The findings are reported in PNAS.