Electroconvulsive therapy (ECT) has always seemed like a barbaric treatment. Even though anesthesia now makes the procedure itself painless for patients, it still involves literally shocking the delicate electrical systems of the brain to produce seizures and may cause painful muscle spasms and memory problems afterwards. Still, after seven decades of use, ECT remains the most effective treatment known for severe depression — and a new study offers intriguing hints as to why.

Researchers in Scotland used fMRI to scan the brains of nine people with profound depression, both before and after ECT. The patients had all failed to respond to antidepressants or other therapies and none had had ECT in the previous six months. The scientists found that after ECT — given twice a week until symptoms lifted — patients showed significant decreases in connectivity between certain parts of the brain.

Specifically, the researchers found that the treatment dampened the connections within and radiating out from a region called the dorsolateral prefrontal cortex (DLPFC), but only on the left side of the brain. The left DLPFC has long been associated with negative thoughts, criticism, anxiety, pessimism and rumination. The same region in the right hemisphere appears to handle more uplifting, optimistic and cheery ideas. Healthy thinking and planning requires a balance of both.

Until now, researchers really didn’t know how ECT worked. But the new findings may help reassure doctors and patients who use it. “We believe we’ve solved a 70-year-old therapeutic riddle because our study reveals that ECT affects the way different parts of the brain involved in depression connect with one another,” lead author Ian Reid, a professor of psychiatry at the University of Aberdeen, said in a statement.

“When the mechanisms of illness and recovery are not fully known, as is the case in depression, there’s a decided advantage in stepping back and taking a look at the big picture. This work has done just that,” says Aimee Hunter, assistant professor of psychiatry at University of California, Los Angeles, who was not associated with the study.

It’s hard to determine whether excess activity in the left DLPFC causes depressive thinking, or whether a depressed person’s chronic negative focus essentially exercises the DLPFC and grows it disproportionately — as would happen if you lifted weights with only one arm. It’s possible also that each condition exacerbates the other to create an imbalance. “It is tempting to speculate that ECT might act to rebalance hemispheric activity [on the right and left side] though modulation of connectivity,” the authors write.

Researchers increasingly suspect that the pathology of depression may involve having too many connections between certain brain areas, a problem known as “hyperconnectivity.” Though it might seem counterintuitive that depression, which is marked by low mood and often, low energy, would be the result of an overly wired brain, research suggests that too much wiring can be as problematic as too little.

In a study published last month, researchers including Hunter used a technique called QEEG, which measures brain activity through a cap of electrodes placed on the scalp, and found greater connectivity in numerous brain regions in more than 100 participants with major depression. The DLPFC was especially affected, though this study found extra connections on both sides of the brain.

“Their findings are also interesting in the context of recent work from our lab led by Andrew Leuchter, which showed increased connectivity, i.e., “hyperconnectivity” in depressed subjects,” says Hunter.

Other studies have also found that antidepressants may work by reducing connectivity between frontal brain regions involved in emotional control and lower regions that generate emotions. Further, research has associated hyperconnectivity in the brain to autism spectrum disorders, which are frequently associated with depression.

Interestingly, however, both antidepressants and ECT have been found to increase levels of nerve growth factors that trigger the birth of new brain cells and revitalize damaged connections in an area of the brain known as the hippocampus. That suggests that while there may be too many connections in some areas of the depressed brain, there may be too few in others.

The new study does have some negative implications. ECT has long been notorious for side effects, such as memory problems. So, in some cases, when doctors perform ECT, they attach the electrodes to the right side of the head, because it’s the less dominant side of the brain for most right-handed people. But this research indicates that delivering ECT to the left side of the head — to the left DLPFC — may be more effective. And that suggests that the mood-enhancing benefits of ECT may be inseparable from its memory-related side effects.

Hunter notes that the study also raises questions about excess connectivity that remains even with successful treatment. “Do some types or regions of connectivity indicate vulnerability to depression, i.e., a “trait” marker, whereas other regions of connectivity related to one’s active or current “state” of depression?,” she asks. Or, perhaps these extra connections produce the more accurate perception of reality that studies have repeatedly found in people with depression: a clearer vision that can bring insight, not just pain.

The study was published in the Proceedings of the National Academy of Sciences.

Maia Szalavitz is a health writer for TIME.com. Find her on Twitter at @maiasz. You can also continue the discussion on TIME Healthland’s Facebook page and on Twitter at @TIMEHealthland.