People often ask if there is some evolutionary or adaptive advantage to depression, perhaps hoping that there is at least some reason behind the painful experience. There are certainly some reasons to speculate about possible evolutionary advantages of depression, but it is difficult to structure research to give definitive answers to things that happened far in the past.
First, we must keep in mind that the conditions experienced by primitive humans were quite different from those of today. Our ancestors lived in small bands of foragers and had few choices about how to spend their time. On the other hand, like us, they had to care for their infants for a matter of years before the children could live on their own. Other animals usually have a much shorter period of immaturity.
An adaptive function is something that has changed in the organism such that it is subsequently able to live better and reproduce more abundantly than before. For example, our early ancestors developed stereoscopic vision which allows better depth perception. Earlier animals and birds do not have this adaptation. Keep in mind that adaptations in this sense are usually universal in a species, so when we discuss the adaptive function of “low” mood or sadness, we are talking about all humans, not just those who are being treated for an illness.
It is frequently suggested that sadness and low mood evolved in situations where low energy and inhibited risk-taking would promote the safety of the depressed person by keeping them close to home during times of increased vulnerability. This would explain why, up until puberty, males and females have similar rates of depression, but during the peak childbearing years, women experience more sadness and depression, resulting, perhaps, in their keeping children and families close to home and promoting bonding between mother and child.
This does not explain the existence of major depressive disorder (MDD), which tends to isolate sufferers from even close family members, but it is suggested that MDD may be some kind of disruption or malignancy on the basically positive experience of low mood. It is also not clear that in hunter-gatherer bands foraging for food is an exclusively male task. Women in such contexts are/were often responsible for considerable amounts of activity in finding plant foods and even learning to cultivate grains and vegetables close to home. Depression would not seem to be very adaptive in this area.
Another approach links seasonal affective disorder (SAD) to an evolutionary adaptation in temperate climates. People experience mild hypomania during spring and early summer, followed by low mood and lowered motivation during the longer nights of winter. This means that children are often conceived during the spring and delivered during the winter, when parents can be expected to be staying closer to home and perhaps engaging in more family bonding and child care.
For further reading:
Evolutionary Theories of Depression: a critical review
The Secret LInk Between Evolution and Depression
Seasonal affective disorder: a vestigial evolutionary advantage?