There's no single cause of depression. It can occur for a variety of reasons and it has many different triggers.
For some people, an upsetting or stressful life event, such as bereavement, divorce, illness, redundancy and job or money worries, can be the cause.
Different causes can often combine to trigger depression. For example, you may feel low after being ill and then experience a traumatic event, such as a bereavement, which brings on depression.
People often talk about a "downward spiral" of events that leads to depression. For example, if your relationship with your partner breaks down, you're likely to feel low, you may stop seeing friends and family and you may start drinking more. All of this can make you feel worse and trigger depression.
Some studies have also suggested that you're more likely to get depression as you get older, and that it's more common in people who live in difficult social and economic circumstances.
It's thought that your chance of getting severe depression may be partly affected by the genes you inherit from your parents.
Stressful events
Most people take time to come to terms with stressful events, such as bereavement or a relationship breakdown. When these stressful events occur, your risk of becoming depressed is increased if you stop seeing your friends and family and try to deal with your problems on your own.
Personality
You may be more vulnerable to depression if you have certain personality traits, such as low self-esteem or being overly self-critical. This may be because of the genes you've inherited from your parents, your early life experiences, or both.
Family history
If someone in your family has had depression in the past, such as a parent, sister or brother, it's more likely that you'll also develop it.
It's thought that severe depression in particular may be partly caused by the genes you inherit from your parents.
But depression is usually caused by a combination of triggers such as life events, so having a family history of depression does not always mean that you'll develop it.
Pregnancy and giving birth
Some women are particularly vulnerable to depression after pregnancy. The hormonal and physical changes, as well as the added responsibility of a new life, can lead to postnatal depression.
Sometimes depression starts before you give birth. Depression in pregnancy is known as antenatal depression.
Menopause
Menopause is when your periods stop due to lower hormone levels. Sometimes menopause can trigger depression, particularly in the first few years.
Menopause can also cause symptoms such as sadness and mood swings. Mental health symptoms caused by menopause are different from depression.
Loneliness
Feeling lonely, caused by things such as becoming cut off from your family and friends, can increase your risk of depression.
Alcohol and drugs
When life is getting them down, some people try to cope by drinking too much alcohol or taking drugs. This can result in a spiral of depression.
Cannabis can help you relax, but there's evidence that it can also bring on depression, particularly in teenagers.
"Drowning your sorrows" with a drink is also not recommended. Alcohol affects the chemistry of the brain, which increases the risk of depression.
Illness
You may have a higher risk of depression if you have a longstanding or life-threatening illness, such as coronary heart disease, cancer or a condition that causes long-term pain.
Head injuries are also an often under-recognised cause of depression. A severe head injury can trigger mood swings and emotional problems.
In some people an underactive thyroid (hypothyroidism) can cause depression.