That is as they say “the million dollar question.”
Though it has improved significantly in recent years, our understanding of clinical depression is far from perfect.
It seems to be have many factors: biological, psychological, social and environmental. Depression can be brought about by a particularly stressful event but biology still plays a part as you genetics determine certain thing about you, such how many of a certain kind of receptor you have in you brain. Realistically speaking depression is caused by several things all compounding eachother. It is not going to turn out to be just one thing, diseases in general and mental illnesses in particular are very complex so it is most likely that many factors come into play to cause depression.
Studying the brains of people suffering from depression has lead to theories about depression such as the monoamine hypothesis which links depression with abnormally low levels of certain neurotransmitters (chemical that carry signals) in the brain. Other physiological changes have also been observed.
There is a lot of psychological theory about it, but I’m afraid I do not feel qualified to discuss that as I do not fully understand it.