Confronted with some of life's upsetting experiences - marriage breakdown, unemployment, bereavement, failure of any kind - many people become depressed. But others don't. Why is this?

A person who goes through experiences like that and does not get depressed has a measure of what in the psychiatric trade is known as "resilience".

According to Manchester University psychologist Dr Rebecca Elliott, we are all situated somewhere on a sliding scale.

"At one end you have people who are very vulnerable. In the face of quite low stress, or none at all, they'll develop a mental health problem," she says.

"At the other end, you have people who life has dealt a quite appalling hand with all sorts of stressful experiences, and yet they remain positive and optimistic." Most of us, she thinks, are somewhere in the middle.

A measure of resilience Aeron, a subject in the Manchester study: I used to have a business that we ended up having to close. I lost my employment, my income, and my home. I'm generally a happy person. Everybody has stressful moments but there would be something wrong with you if you were happy all the time. But I haven't ever had an episode of depression. In my childhood, when I first realised I was gay, I didn't come out to my parents or friends, not until I was much older. I think, perhaps, it resulted in me building up a strong defence mechanism and helped me deal with situations better later on in life. I think that if there's a problem there's always a remedy. It's not that I don't think about stressful issues in my life, but I always think you can find a solution.

But what is this resilience? Is it something we inherit or do we learn it? Can it be traced in the chemistry of the brain? Or in its wiring, or its electrical activity? And if we lack it, can we acquire it?

The answer, regrettably, to all those questions is much the same. We don't really know. But we'd like to, and we need to. According to the World Health Organization, depression affects just over 120 million people worldwide.

"We think about a fifth of the UK population will suffer from depression at some point in their lifetime," says Bill Deakin, professor of psychiatry at Manchester University. Worryingly, he adds that more people are getting depressed now than in the past, and that it is beginning to affect younger people.

With the support of the Medical Research Council, Bill Deakin, Rebecca Elliott and their colleagues are peering into the brain, trying to fathom the origins and nature of resilience. They think that a better understanding of it might pay dividends in helping those who lack it.

The subjects of their study are a mixed bunch - intentionally so. Some have suffered bouts of depression, others have not. Some have had more than their share of adverse life events, while others have had an easier time of it.

In knowing where to start looking for the differences that might underpin resilience to depression the Manchester group has the advantage of being able to draw on previous work that has investigated resilience to post-traumatic stress disorder.

This, says Bill Deakin, has pointed them to several relevant features of brain function. They include cognitive flexibility - our capacity to adapt our thinking to different situations - and also the extent to which our brains concentrate on processing and remembering happy, as opposed to sad, information.

Emotional memory

Each subject in the Manchester study has been allocated to one of four groups based on the four possible combinations of high and low life stress, with or without depression. All have given saliva samples from which their stress hormone levels can be measured, and many of them will undergo a brain scan.

Depression - the global picture Depression affects about 121 million people worldwide

Among the leading causes of disability worldwide

Fewer than 25% of those affected have access to effective treatments

2011 survey found 15% of the population from high-income countries were likely to get depression over their lifetime - in low and middle-income countries the rate was 11%

Women twice as likely to suffer depression as men Source: WHO World Mental Health Survey Initiative Lab UK: BBC stress test results

A scanning technique much used by brain researchers called functional magnetic resonance imaging allows them to see which parts of the brain are active while subjects are performing specific tasks.

"In one task we give them pictures to look at which are emotionally charged," says Rebecca Elliot. "They have to memorise them." Shortly afterward they're shown these pictures again, with others, and have to identify those they've seen already. "This probes emotional memory - how well people remember material which has an emotional component to it."

The research is not yet complete, so Rebecca Elliott can't say whether there are distinct differences in brain function between the groups. But there are encouraging hints, such as the correlations she's finding between the psychological measurements of her subjects' resilience and how they perform on some of the tests.

"For example, our early data suggest that people who are more resilient are more likely to recognise happy faces and less likely to recognise sad or fearful faces. The more resilient someone is, the better they remember positive words and pictures."

Precisely how a clinician might eventually use whatever the Manchester research reveals about our brain activity is still an open question. What we refer to as resilience is the outcome of a complex and continuing set of interactions between our genes, our body chemistry, the wiring of our brains, and our life experiences.

But broadly speaking, the hope is that an understanding of the brain activity that underpins resilience might offer pointers towards new treatments, or better ways of using existing ones.

A resilience pill?

Bill Deakin talks of using brain scanning to create what he calls a "neuroscientific profile" of an individual's problem. This might be used to identify relevant aims and goals in deciding on the best treatment.

A patient may turn out to have normally functioning cognitive flexibility but a tendency to dwell on sad thoughts. "This might allow you to tailor-make a therapy to reduce the likelihood of a further episode of depression," says Deakin. In the first instance this would most likely be a talking therapy of some kind.

Responding to the suggestion that a drug, a daily "resilience pill", tailored to our brain activity or chemistry might be a useful development, Rebecca Elliott is cautious. "I suppose this is something that would theoretically be possible," she says. "Whether people would be willing to take that kind of drug, I'm not sure."

But whatever the means, finding some way to boost resilience is an ambition well worth pursuing. To be assured of that you have only to compare Aeron's experiences with those of Pauline, another of the Manchester research subjects.

While out of work, struggling financially, and single-handedly responsible for three children, Pauline had several bouts of depression during which she felt completely isolated. "And emotionally I was very detached. I would come in and sit on my bed and cry. And when it got so bad I didn't want to be with the children, that's when I went to the doctor."

No clinician can yet prescribe what she most needs - resilience. But one day… maybe.