A number of authors have suggested that mood disorders are an evolutionary adaptation. A low or depressed mood can increase an individual's ability to cope with situations in which the effort to pursue a major goal could result in danger, loss, or wasted effort. In such situations, low motivation may give an advantage by inhibiting certain actions. This theory helps to explain why mood disorders are so prevalent, and why they so often strike people during their peak reproductive years. These characteristics would be difficult to understand if depression were a dysfunction.
Nesse R (2000). "Is Depression an Adaptation?". Arch. Gen. Psychiatry 57 (1): 14–20