Depression must serve some kind of purpose for humans, else it wouldn't be around. After eons of evolution, the traits most necessary for our survival have arisen through natural selection. If depression was a pure detriment to our survival, humans prone to it should not have had success passing on their genes. Yet, depression is alive and well, so what purpose might it serve?
Perhaps anxiety can help give us an answer. One theory on the purpose of anxiety is that it makes us vigilant; it helps us keep an eye open for predators. Back in the early days of the Homo genus, we'd be on the lookout for that lion, avoid its location, live another day, and pass on our genes eventually. Even now, anxiety can help us spot an unsafe situation and steer away from it.
Does or did depression serve a similar purpose? Does it assist us in living another day? It seems a bit more difficult to identify its positive aspects. For instance, one manifestation of depression can be fatigue. The depressed individual feels tired and has little or no interest in engaging in life and the tasks it entails. Nowadays, those tasks might mean going to work or school but back in our savannah days, survival tasks would mean hunting, foraging, or any number of tasks. Not seeking out food and water are surefire ways to bring about our own demise.
So, why is depression still around? One possibility that comes to mind is the pessimism that depression brings. Perhaps the depressed individuals often sat out some of the dangerous situations. "Why bother hunting that woolly mammoth? It's gonna end up bad." The depression engendered a negative viewpoint that sometimes prevented death or injury. The optimistic individuals might have been more capricious, engaged in hunts that were dangerous, and died in the process.
How about nowadays? We're not sitting out a fight with a woolly mammoth. Instead, if depressed, we may sit out social situations, work, school, family functions, chores, but missing any of those doesn't seem to have much benefit. Doing so doesn't put us at less risk. With the mammoth you could go out and die, but in social situations, you can just feel out of place or make a fool of yourself.
One could look at modern life and question the security it has brought. We don't have to worry much about our immediate survival. Most of us can feel pretty confident we're are going to be alive tomorrow. Maybe not being face-to-face with life or death on a daily basis has taken away some of our motivation. Sure, not making a living or connecting with friends or family has a negative effect on the quality of our lives and could lead to scarcer resources and protection down the line, but it's not quite the same as knowing you have to get moving and find some water or that next meal.
Not sure where these leaves the question of depression's utility. If you have any ideas, let me know.