Religious and transcendental experiences have always played an important role in human evolution, from keeping tribes together to pushing societies in new directions. Humans may even be wired to crave such experiences, with some turning to psychedelic drugs as shortcuts to enjoying them.

It’s down to connection and cooperation, according to James Carney, a psychologist at Lancaster University. “If I believe myself to be at one with my tribe, my church or the universe itself, it’s easier to accept others getting the benefits of my hard work,” he writes in The Conversation. “The connection is important because it makes people more willing to cooperate when the results of doing so are not immediately beneficial.”

Psychedelic drugs mimic the states of mind that help promote human cooperation, which is crucial for survival as groups become larger and bonds must be formed between strangers. That’s why Carney thinks we may be wired to seek experiences that put us in those states of mind.

This not to say humans evolved to take psychedelic drugs. But it means that one explanation for psychedelic drug use, in evolutionary terms, is as a shortcut to the transcendental states we enjoy.

There are two basic principles to how psychedelics work. One is disintegration—different networks in the brain become less cohesive. The second is desegregation—the brain’s systems that specialize in particular functions become less distinct. Together, psychedelics break down entrenched aspects of our consciousness, allow new connections to form, and realizations to occur.

Robin Carhart-Harris, a psychedelics researcher at Imperial College London, has used this theory to successfully treat depression with magic mushrooms. The drug experience allowed patients to feel a connection, even with people who caused them pain, and an understanding of what may have caused them to behave in the way they did.

Carhart-Harris compares the feeling of connecting with things beyond oneself to the “overview effect” felt by astronauts when they look back on the Earth: