Melissa Schilling, a professor at New York University, performed her own review of studies connecting diabetes to Alzheimer’s in 2016. She sought to reconcile two confusing trends. People who have type 2 diabetes are about twice as likely to get Alzheimer’s, and people who have diabetes and are treated with insulin are also more likely to get Alzheimer’s, suggesting elevated insulin plays a role in Alzheimer’s. In fact, many studies have found that elevated insulin, or “hyperinsulinemia,” significantly increases your risk of Alzheimer’s. On the other hand, people with type 1 diabetes, who don’t make insulin at all, are also thought to have a higher risk of Alzheimer’s. How could these both be true?

Schilling posits this happens because of the insulin-degrading enzyme, a product of insulin that breaks down both insulin and amyloid proteins in the brain—the same proteins that clump up and lead to Alzheimer’s disease. People who don’t have enough insulin, like those whose bodies’ ability to produce insulin has been tapped out by diabetes, aren’t going to make enough of this enzyme to break up those brain clumps. Meanwhile, in people who use insulin to treat their diabetes and end up with a surplus of insulin, most of this enzyme gets used up breaking that insulin down, leaving not enough enzyme to address those amyloid brain clumps.

According to Schilling, this can happen even in people who don’t have diabetes yet—who are in a state known as “prediabetes.” It simply means your blood sugar is higher than normal, and it’s something that affects roughly 86 million Americans.

Schilling is not primarily a medical researcher; she’s just interested in the topic. But Rosebud Roberts, a professor of epidemiology and neurology at the Mayo Clinic, agreed with her interpretation.

In a 2012 study, Roberts broke nearly 1,000 people down into four groups based on how much of their diet came from carbohydrates. The group that ate the most carbs had an 80 percent higher chance of developing mild cognitive impairment—a pit stop on the way to dementia—than those who ate the smallest amount of carbs. People with mild cognitive impairment, or MCI, can dress and feed themselves, but they have trouble with more complex tasks. Intervening in MCI can help prevent dementia.

Rebecca Gottesman, a professor of neurology at Johns Hopkins, cautions that the findings on carbs aren’t as well-established as those on diabetes. “It’s hard to be sure at this stage, what an ‘ideal’ diet would look like,” she said. “There’s a suggestion that a Mediterranean diet, for example, may be good for brain health.”

But she says there are several theories out there to explain the connection between high blood sugar and dementia. Diabetes can also weaken the blood vessels, which increases the likelihood that you’ll have ministrokes in the brain, causing various forms of dementia. A high intake of simple sugars can make cells, including those in the brain, insulin resistant, which could cause the brain cells to die. Meanwhile, eating too much in general can cause obesity. The extra fat in obese people releases cytokines, or inflammatory proteins that can also contribute to cognitive deterioration, Roberts said. In one study by Gottesman, obesity doubled a person’s risk of having elevated amyloid proteins in their brains later in life.