After the British painter Samuel Palmer lost his 19-year-old son in 1861, he called the death "the catastrophe of my life." In a letter to a friend, he described the anguish:

"I dreamed one night that dear More was alive again and that after throwing my arms round his neck and finding beyond all doubt that I had my living son in my embrace – we went thoroughly into the subject, and found that the death and funeral at Abinger had been fictitious. For a second after waking the joy remained – then came the knell that wakes me every morning – More is dead! More is dead!"

Palmer's tragedy probably resonates with anyone who has known loss. Sadness, from the profound grief of a parent to transient moodiness of a child, is a universal emotion. It also, on its face, doesn't make a great deal of sense.

Why would an emotion that prompts people to cry, mope, lose their appetites and withdraw from the world do any good? What's the point?

Psychologists have been exploring those questions since the days of Sigmund Freud, and they've discovered some very compelling answers. In fact, sadness – at least the mild kind – might help us process memories, navigate uncertain social situations and even stamp out the cognitive biases that color our judgments. More provocatively, the benefits of sadness might even explain the horror of major depression.

The evolution of sadness

It's simple to imagine how emotions evolved to keep our ancestors safe. A Paleolithic person without a healthy sense of fear would likely fall off a cliff or get mauled by a bear before passing on their genetic lineage; likewise, pleasure prompts us to engage in behaviors crucial to successful reproduction, like eating and sex.

Evolutionary theorists think sadness might play its own survival role. In work done in the 1940s and 1950s, John Bowlby, a British psychologist, developed the theory of attachment. This theory, still influential today, held that infants and children are motivated to stay close to their caregivers in order to maintain their survival. In healthy attachment, the caregiver is sensitive to the child's needs, and the child feels comfortable roaming a safe distance away from that caregiver, knowing their base of safety is nearby.

Sadness, from this point of view, is the emotion that makes attachment work. Sadness accompanies loss (such as the loss of a parental figure), and encourages the sad person to remedy that loss (by finding out where Mom went). Of course, if the missing person has died, the loss can't be remedied.

"Loss of a loved person is one of the most intensely painful experiences any human being can suffer," Bowlby wrote in his 1980 book, " Attachment and Loss, Volume III: Loss, Sadness and Depression."

In this view, sadness is the price we pay for our ability to form bonds with one another. The price can be high indeed; Bowlby cites a study of 56 Swedish mothers who had lost an infant and found that one to two years later, one-third of them had severe psychiatric disorders such as depression and anxiety.

Sadness might also be a way to navigate loss in a social world. Some theorists think the emotion evolved as a cry for help. Tears, in particular, might be a way of saying, "Hey, I'm not okay." In a 2009 paper in the journal Evolutionary Psychology, for example, Tel Aviv University researchers suggest that tears signal vulnerability and promote bonding. And a 2013 study in the same journal flashed teary faces on a screen for mere milliseconds, too little time for the tears to register consciously. The study found that whether a face was sad or neutral, tears prompted participants to later say that that same person was in more need of social support than if there had been no tears — even though the participants hadn't consciously noticed that the people in the photos were crying.

The benefits of feeling blue

The sadness accompanying a great loss is deep and often debilitating. A mildly bad mood, on the other hand, might be beneficial.

"Mild sadness seems to function as an alarm signal, indicating that the current situation is new, unfamiliar and challenging," said Joe Forgas, a psychologist at the University of New South Wales in Australia.

This signal seems to put the brain on high alert. Sad people have a more accurate eye for details, Forgas and his colleagues have found, and they're more reliable eyewitnesses to confusing events. They're also less likely to fall into common cognitive traps, like believing that a handsome person must be nice (the halo effect) or remembering initial information better than information added later (the primacy effect).

In some cases, sadness might even make you a better person. In one 2010 study, Forgas and his team asked participants to play the dictator game, in which one person is given a certain amount of cash and then must decide how much to keep and how much to pass on to a partner. Typically, people do end up giving some money away, suggesting that we're not entirely driven by greed or self-interest.

In Forgas' version of the game, some participants were in a happy mood, and some were sad. Surprisingly, the people who were feeling down shared more of their bounty than the sunny, chipper types. The researchers suspect that sad people were in an externally-oriented state and were thus more concerned with social norms and what their partner might think of them than the happy participants.

Going deeper: why does depression exist?

If sadness has some clear benefits, the pictures gets much more murky when it comes to depression. Major depression makes people less accurate at identifying others' emotions, impairs working memory and damages cognitive control, as reviewed in a 2007 paper in the journal Emotion.

Major depression can also lead to death — it's a major risk factor for suicide. Which raises a question: Why would such a debilitating condition occur so frequently? According to the National Institute of Mental Health (NIMH), some 6.7 percent of U.S. adults experienced a major depressive episode in 2013. The lifetime risk of experiencing depression hovers somewhere around 16 percent. The average age of onset is 32, and 3.3 percent of teens have experienced serious depression, according to the NIMH. The high numbers have evolutionary theorists asking questions.

"What's really weird is to see a healthy 20-year-old person with no sign of infection, no sign of injury, with a severe brain dysfunction at very high rates," said Ed Hagen, director of the bioanthropology lab at Washington State University Vancouver. Depression dwarfs other brain disorders such as schizophrenia, which affects about 1 percent of people over the lifetime.

"We don't see any other major dysfunction in any other organ at these high rates in otherwise healthy [young people]" Hagen said. "Could it really be true that our brains are dysfunctional at this high rate at a very young age?"

In Hagen's view, the frequency of depression suggests that the disorder is telling us something important: It's like the pain of a broken ankle, signaling a deeper problem that needs to be fixed.

"If you walked around on a broken ankle as if nothing was wrong, you'd make your ankle a lot worse," Hagen said. "If you did something stupid to break that ankle you need to think about what you did and don't do it again next time." Psychic pain, he said, may serve the same purpose. Even suicide attempts he said, might be an extreme way to signal to others that something is deeply wrong and must change quickly.

This isn't to say that depression shouldn't be treated, or that people can simply bootstrap their way out of a depressive episode; instead, Hagen argues that prescribing antidepressants without exploring the triggers of the depression through therapy is short-sighted.

"That would have the same negative consequences as giving people a bunch of Percocet but not actually fixing the broken ankle," he said.

Not everyone agrees with this evolutionary line of thinking. Many researchers think of depression as less like the pain of a broken ankle and more like cancer. Instead of an unpleasant but helpful signal, they say, depression is normal sadness run amok, much like cancer is normal cell proliferation that has gotten out of control. Depression is complex, with many genetic pathways to the disease, these researchers point out. And when the genetics are complicated, even traits that are more harmful than helpful can persist.

"Depression is a very serious illness, leading to an inability to cope and often leading to suicide," Forgas said. "Any beneficial effects it may have are likely to be coincidental and minor compared to its overwhelming cost."

There is a third metaphor that might explain high rates of depression. It's possible, Hagen said, that depression is like diabetes, or obesity — a reflection of the ways in which our modern environment fails to match up with the ancestral conditions in which our brains evolved. Free access to the fatty, sugary food our brains evolved to crave has led to high obesity rates. Likewise, depression is linked to urban living, which is on the rise. Modern life is also more isolated and less active than our ancestors' existence. These factors might help explain why depression is relatively rampant.

"Either depression has some function," Hagen said, "or there's a pretty severe mismatch between the modern environment and the environment we evolved in."

While the relative benefits of depression are very much up for debate, the benefits of sadness deserve the spotlight. The "cultural obsession" of seeking constant happiness is a mistake, Forgas said.

"Human beings have a variety of evolved affective responses for good reason, and we should accept that mild negative affect is part of life and should be accepted as such," he said. "The popular tendency in the media to represent positive affect as the only acceptable state to be in actually creates more suffering, since it posits an unattainable standard, paradoxically likely to cause more frustration and misery."