Anthony Stevens and John Price wrote

depression is an adaptive response to losing rank and conceiving of oneself as a loser. The adaptive function of the depression, according to rank theory, is to facilitate losing and to promote accommodation to the fact that one has lost. In other words, the depressive state evolved to promote the acceptance of the subordinate role…

an internal inhibitory process comes into operation which causes the individual to cease competing and reduce his level of aspiration. This inhibitory process is involuntary and results in the loss of energy, depressed mood, sleep disturbance, poor appetite, retarded movements, and loss of confidence which are typical characteristics of depression.

The hypothesis was (the excerpt is from a book written in 1996) that depression allows losers to adapt peacefully to a loss of status, and thus it improves the survival of the overall group. I am not sure whether this belongs in Tyler Cowen’s neurodiversity sphere or Robin Hanson’s status and signaling sphere. Pointer from Patri Friedman.