Magic mushrooms got their name for a reason. Psilocybin — the active chemical in so-called “magic mushrooms” — works on the mind in amazing ways to breed new insights and break from negativity and intransigence.

Psilocybin frees the brain from its rigid patterns and ego-driven assumptions, and allows the user to look at the world — and him or herself — from a whole new perspective. Many mushroom experiences also are accompanied by waves of good feelings and psychedelic visions of sound and color.

New research is helping us understand how the mushrooms work their magic. A study published last year in the Journal of the Royal Society found that psilocybin actually changes the brain’s organizational framework and allows information to pass from section to section in new or underused neural networks, bypassing the old, well-trodden pathways.

The new connections are not some unorganized jumble, however. “A simple reading of this result would be that the effect of psilocybin is to relax the constraints on brain function, ascribing cognition a more flexible quality, but when looking at the edge level, the picture becomes more complex,” the report notes. “The brain does not simply become a random system after psilocybin injection, but instead retains some organizational features, albeit different from the normal state.”

“We find that the psychedelic state is associated with a less constrained and more intercommunicative mode of brain function,” the study concludes, “which is consistent with descriptions of the nature of consciousness in the psychedelic state.”

These results build on other evidence about how psilocybin can rewire the brain. A previous study at the Imperial College London showed that brain activity diminished in certain areas when subjects took the substance, particularly in the part of the brain responsible for a sense of self.

Meanwhile, a follow-up study showed that more activity occurred in the hippocampus and anterior cingulate cortex, areas associated with emotion and memory. The result was a brain pattern similar to someone who is dreaming.

“I was fascinated to see similarities between the pattern of brain activity in a psychedelic state and the pattern of brain activity during dream sleep,” lead researcher Robin Carhart-Harris said in a statement. “People often describe taking psilocybin as producing a dreamlike state and our findings have, for the first time, provided a physical representation for the experience in the brain.”

The new pathways help explain why psilocybin is useful in combating mental disorders like depression and PTSD. By building new highways across the brain, the chemical allows people to shake lose their old assumptions and stimulus-response reactions. In effect, it allows you to reset your brain.

“People who get into depressive thinking, their brains are overconnected,” researcher David Nutt told Psychology Today . “We think the dampening down of that circuit allows people to escape from being chained to that thinking process.”

The impact is long lasting, as well. A Johns Hopkins study found that a majority of subjects who took psilocybin had personality changes that lasted for over a year. Almost all participants in another Hopkins psilocybin study said the experience was one of the most meaningful of their lives.

“It does appear to be an amazingly interesting tool for unlocking these mysteries of human consciousness,” Roland Griffiths, a researcher with Johns Hopkins who has done extensive work with psilocybin, said in an interview with the Multidisciplinary Association for Psychedelic Studies. “The core feature of the mystical experience is this strong sense of the interconnectedness of all things, where there’s a rising sense of not only self-confidence and clarity, but of communal responsibility — of altruism and social justice — a felt sense of the Golden Rule: to do unto others as you would have them do unto you… Understanding the nature of these effects, and their consequences, may be key to the survival of our species.”