According to author and psychiatrist Jeffrey P. Kahn, M.D., in his book Angst: Origins of Anxiety & Depression, today’s disorders might’ve been yesterday’s valuable social instincts.

Today’s panic disorder might’ve prevented our ancestors from venturing to potentially dangerous places, far away from their families and tribes.

Today’s social anxiety might’ve maintained social hierarchies and peace in primitive times.

Today’s obsessive-compulsive disorder (OCD) might’ve helped our ancestors keep tidy and safe nests.

In part one of his book, Kahn delves into the social instincts that underlie these five disorders: panic disorder, social anxiety, OCD, atypical depression and melancholic depression. In part two he delves into the advancement of civilization and the rise of reason (which explains why we’re not shackled to our social instincts, running amok; we’re able to override these cues).

Angst may be the result of a tug-of-war between our primal social instincts and our modern-day rational, civilized selves. According to Kahn:

Amazingly, those instinctive biological sensations that told our primeval ancestors how to comport themselves in society can today turn up as conscious emotional pain. So when you feel the pain of angst, you are actually feeling the unrecognized call of ancient social instincts. These days we don’t obey these painful instincts blindly. They become especially unpleasant when they conflict with our rational choices — that is, when we experience them as anxiety and depressive disorders. So, in our modern context, these social instincts can become so intense that they backfire, certainly not providing just the socially adaptive benefits that evolution had in mind.

In Angst Kahn draws from the work of Charles Darwin and Sigmund Freud along with scientific studies and theories from fields such as psychology and evolutionary biology.

Here’s a closer look at ancient instincts and two disorders: social anxiety and OCD.

Social Anxiety Disorder

People with social anxiety fear embarrassment, especially when they’re being observed. Their anxiety might heighten during speaking events, work evaluations and social situations. They might worry about everything from their appearance to their performance. They’re also self-critical.

For our ancestors, however, social anxiety might’ve been beneficial. It might’ve kept them from challenging “a ruthless hierarchy,” Kahn writes. “Our ancestors wouldn’t want to find themselves beaten down, or thrown out of the tribe – another way they’d be on their own and exposed to all sorts of dangers.”

Kahn speculates that our ancestors had a biologically based social hierarchy. Today, our society has a clear-cut structure. (Work is a good example of a hierarchy, with managers, bosses and higher-ups.) But our ancestors did not. Having a biologically determined hierarchy kept our ancestors in line and tempered competition.

“Social Anxiety today may reflect the biology of low social rank. Indeed, people with Social Anxiety may think or act as if they have a lower ranking in the hierarchy, not to mention having more submissive behavior and less closeness among their peers, friends and romantic partners.”

Obsessive-Compulsive Disorder

In ancient societies OCD-like traits would’ve been helpful for survival and keeping a sanitary, safe home. As Kahn writes:

The evolutionary advantage of OCD is that you don’t forget some very necessary concerns and tasks. Our ancestors wouldn’t want to find themselves living in filth (though since they didn’t know about germs, they weren’t actually germaphobes), unable to find or protect their homes, left without food or tools in an emergency, or stealing each other’s food or spouses. The instincts behind OCD help to prevent those problems.

Long ago, they also might’ve helped mothers protect their young and ensure their survival. According to Kahn, today, many women who have postpartum OCD struggle with “cleanliness and arranging behaviors, and [with] controlling harmful thoughts about the newborn.”

This is similar to what happens with other mammals. “They clean up the newborns and the afterbirth and they keep the nest tidy.” Their instincts also are to protect their kin from predators and invaders.

For some species, these predators might even include family and other adults in the same group. “Having aggressive thoughts already in mind makes for a quicker defense,” Kahn writes.

Whatever the origins, one thing is clear: These disorders disrupt the daily lives of many individuals. Social anxiety affects about seven percent of the population, and OCD affects about one to two percent.

Both disorders are debilitating. Kahn notes that, on average, people with OCD spend almost six hours a day preoccupied with their obsessive thoughts and almost five hours with compulsive behaviors. People with social anxiety disorder have lower levels of career success and may have fewer friendships.

Fortunately, both disorders — along with the other illnesses Kahn writes about — are highly treatable with psychotherapy and medication. (This website is a valuable resource for postpartum illnesses.) In other words, if you’re struggling with anxiety or depression, you can get better. The key is to get help.