Along with pomegranates, blueberries, and kale — dark chocolate is now a health food.

At Vox, we started to wonder: How in the world did a candy become a superfood?

In our investigation, we found that you can thank a decades-long effort by the chocolate industry.

Over the past 30 years, food companies like Nestlé, Mars, Barry Callebaut, and Hershey’s — among the world’s biggest producers of chocolate — have poured millions of dollars into scientific studies and research grants that support cocoa science.

Industry funding in nutrition science is not uncommon — grape juice makers and walnut growers sponsor studies showing these foods improve driving performance or cut diabetes risk. But Big Chocolate’s foray into nutrition research is a great case study in how an industry can steer the scientific agenda — and some of the best minds in academia — toward studies that will ultimately benefit their bottom line, and not necessarily public health.

At Vox, we examined 100 Mars-funded health studies, and found 98 of them drew positive or favorable conclusions about cocoa and chocolate — promoting everything from chocolate’s heart health benefits to cocoa’s ability to fight disease. This research — and the media hype it inevitably attracts — has yielded a clear shift in the public perception of the products.

One small and flawed study, for example, about the short-term effects of cocoa supplements on cognitive function, was picked up by media outlets, including the New York Times, which trumpeted chocolate — not just cocoa dietary supplements — as a memory aid.

“Mars and [other chocolate companies] made a conscious decision to invest in science to transform the image of their product from a treat to a health food,” said New York University nutrition researcher Marion Nestle (no relation to the chocolate maker). “You can now sit there with your [chocolate bar] and say I’m getting my flavonoids.”

Vox asked Mars’ spokesperson to comment on the concerns of independent researchers about the company’s impact on science, and he responded: “We are always clear that chocolate is a treat, not a snack, food, or meal replacement, and market our products accordingly,” adding, “we do not translate or communicate the outcomes of our cocoa flavanol research program in the context of chocolate.”

Either way, amid an obesity epidemic, this niche of nutrition science has helped build an aura of health around chocolate — and increase consumer demand. Chocolate retail sales in the US have risen from $14.2 billion in 2007 to $18.9 billion in 2017, the market research group Euromonitor International found, at a time when candy sales overall have been waning. Americans are increasingly looking for “healthy indulgences” as they become more aware of nutrition — and turning to snack bars like Kind, or dark chocolate with fruits and nuts, for their fix.

To learn more about chocolate’s transformation into a health food, watch our new video above and subscribe to Vox’s YouTube channel for more.