Humanity is simultaneously incredibly kind and incredibly violent. We commit indescribable atrocities, but also acts of incomprehensible compassion. There is both horror and beauty in our history. Which leads to the question, how do we reconcile this inherent contradiction?

It all goes back to our biology, according to Robert Sapolsky, a neurobiologist at Stanford and author of the book Behave: The Biology of Humans at Our Best and Worst. In fact, all issues of human behavior are, at their core, about biology.

The question of why humans are both kind and violent is a tough one. Sapolsky points out that a lot of it goes back to how easily we put each other in one of two categories: “us” and “them.” And we can process these group categorizations in less than 100 milliseconds. Essentially, we’re hard-wired to like our own group, and dislike outsiders. It’s something that primates (and yes, humans are primates) just do.

But Sapolsky, who’s studied baboons extensively, says that there’s also a lot that separates us from other primates. Humans are able to prevent massacres, to assist people outside of their tribe, to help with no promise of reward. On the flip side, we also kill other humans over ideology and theology, something no chimp or tamarin monkey has ever done.

Perhaps unsurprisingly, our decisions — whether good or bad — are extraordinarily complicated. Even a simple action, like throwing a punch or flipping a switch, is the product of countless factors, Sapolsky says. We’re influenced by subliminary sensory cues we’ve experienced in the last minute. (For example, if you put someone in a room with smelly garbage, they become more socially conservative.)

There’s also hormone levels in your bloodstream. If you raise someone’s testosterone level, they’re more likely to interpret a neutral face as hostile. We’re shaped by our adolescence, our childhood, even our fetal life. If you’re exposed to more stress hormones during your time in your mother’s womb, you’re more likely to be aggressive. And then there are your genes, the culture around you, and the species that humanity has evolved to be.

“In other words,” Sapolsky says, “you are up the creek if you think you can explain our best, worst, [or] in-between behaviors with, ‘Here’s the part of the brain that explains everything. Here’s the gene, the hormone, the childhood experience, the evolutionary mechanism.’ You’ve got to put them all together.”

And after looking at all of these different influences, at how we’re shaped by everything from evolution to sensory signals — free will doesn’t exactly seem plausible, at least according to Sapolsky.

“I don’t think there’s a shred of free will out there. I think free will is what we call the biology we haven’t uncovered yet,” he says.

In the middle ages, we thought epileptic seizures were caused by choosing to consort with Satan, rather of biology. In the '50s, we thought that if kids were having trouble reading, they just weren’t trying hard enough, instead of having a learning disability. We’ve found biological causes for so much of human behavior, and Sapolsky doesn’t see this trend stopping anytime soon.

This idea, that all of human behavior is shaped by biological systems that we barely understand instead of by conscious choices, is difficult to comprehend. It casts so many aspects culture and society in a different light. (Not the least of which is our criminal justice system, which runs on neurobiology that’s over 200 years old.) But, at least you’re not alone in your confusion. Sapolsky’s right there with you.”

“I’m totally intellectually comfortable with the idea that there’s no free will whatsoever,” he says. “At the same time, I haven’t the remotest idea how you’re actually supposed to live if you start believing like that.”