For much of his life, Isaac Newton seemed like he was on the verge of a nervous breakdown. In 1693, the collapse finally arrived: After not sleeping for five days straight, Newton sent letters accusing his friends of conspiring against him. He was refraining from publishing books, he said at one point that year, “for fear that disputes and controversies may be raised against me by ignoramuses.”

Newton was, by many accounts, highly neurotic. Brilliant, but neurotic nonetheless. He was prone to depressive jags, mistrust, and angry outbursts.

Unfortunately, his genius might have been rooted in his maladjustments. His mental state led him to brood over past mistakes, and eventually, a breakthrough would dawn. “I keep the subject constantly before me,” he once said, “and wait till the first dawnings open slowly, by little and little, into a full and clear light.”

Newton’s tendency to dwell on his problems served an example of a phenomenon described in a recent opinion paper in the journal Cell: Trends in Cognitive Sciences. The paper’s thesis is that neurotic people—tense, panicky types who are consumed by gloomy feelings—get that way because they have an overabundance of negative, so-called “self-generated” thoughts. Rather than overreacting to bad experiences, the minds of neurotic people create their own threats.

Adam Perkins, a lecturer in the neurobiology of personality, got the idea for his hypothesis when he attended a lecture by Jonathan Smallwood, a reader in the Department of Psychology at the University of York. Smallwood explained how he had put people in an MRI scanner and allowed them to daydream inside the machine. Afterward, the participants rated their daydreams. Those whose daydreams were more negative had more activity in their medial prefrontal cortex: the region of the brain that processes threats. “I thought, gosh, it seems like they have a built-in threat generator,” Perkins said.

The existing explanation for neuroticism is that neurotic people have a magnified perception of threat: They see a house cat as a tiger, as Perkins says. But that doesn’t help us understand why neurotic people sometimes get lost in whorls of depression and anxiety—even when nothing bad has happened. In other words, it’s not that these individuals overreact to rumors of coming layoffs at their company; they panic even when profits are up and everyone’s getting bonuses. In the throes of his meltdown, Newton had no reason to suspect his friends would betray him.

Smallwood’s experiment led Perkins to hypothesize that the brains of neurotic people are storm-cloud factories.

“It seems like these people have spontaneous brain activity that’s firing off, there’s a trickle-down effect, and it feeds into their more basic threat-processing systems,” he said. “They’ll be sitting in an armchair and their heart rate is 200 and they’re panicking and sweating.”

These negative self-generated thoughts aren’t completely unrealistic, Perkins notes. Neurotic people don’t fear the earth will be invaded by aliens tomorrow. They think their wife will cheat on them on a business trip, even if she’s the most loyal and loving woman in the world.

Strangely, these melancholy thoughts also have an upside: They help in planning, delaying gratification, and, some studies show, with creativity. The more you keep your life’s big problems “constantly before you,” as Newton did, the likelier it is you’ll resolve them.

Still, “self-generated thoughts, when focused on the past, can be pretty depressing,” Perkins said. The constant gloom takes its toll. Neurotic people tend not to be very adept at high-pressure jobs, such as flying fighter planes or defusing bombs. Neuroticism strongly correlates with a risk of psychiatric illness, and it’s at least partly genetic, so people can pass it on to their kids.

To test his theory, Perkins thinks a good follow-up study would be to gather a few hundred people and measure their neuroticism before putting them in a scanner to daydream for a while. The bleaker their musings, the likelier it is that the source of their turmoil is their own minds.

Perkins says neurotic people carry a “camel hump of misery” with them everywhere they go. But just like a camel’s hump, that misery helps nourish its neurotic owner, making him more creative even as it makes him a mess.