“The secret history of the heroin crisis,” Don Winslow writes at Esquire, is rooted in marijuana legalization.

Specifically, Winslow claims that because marijuana legalization in Colorado and other states depleted drug cartels’ revenues — by pushing marijuana out of the black market — the cartels shifted their production over to heroin instead. As a result, heroin has flooded the streets of America, creating an epidemic.

The thesis seeks to shine a light on one of the worst public health crises of the day: In 2014, the opioid painkiller and heroin epidemic led to a record number of drug overdose deaths in 2014 — putting overdose deaths above deaths due to car crashes, gun violence, and HIV at the disease’s height in 1995. Understanding what caused this sudden rise in overdose deaths is crucial to learning how to fix it, and Winslow offers a potential, but troubling, answer.

There’s just one problem with Winslow’s thesis: The basic facts and timing of the opioid epidemic don’t bear it out at all.

Here’s the key argument in Winslow’s piece:

We wanted legal weed, and for the most part, we got it. Four states have legalized it outright, others have decriminalized it, and in many jurisdictions police refuse to enforce the laws that are on the books, creating a de facto street legalization. Good news, right? Not for the Sinaloa Cartel, which by the time Colorado passed Amendment 64 in 2012 had become the dominant cartel in Mexico. Weed was a major profit center for them, but suddenly they couldn't compete against a superior American product that also had drastically lower transportation and security costs. In a single year, the cartel suffered a 40 percent drop in marijuana sales, representing billions of dollars. Mexican marijuana became an almost worthless product. They've basically stopped growing the shit: Once-vast fields in Durango now lie fallow. More good news, right? Yeah, no. Guzmán [head of the Sinaloa Cartel] and his boys are businessmen. They're not going to take a forty-point hit and not do something about it. They had to make up those profits somewhere.

So, Winslow claims, drug cartels doubled down on heroin — understanding that heroin can substitute opioid painkillers for people who are addicted, since it’s a cheaper, more potent opioid.

At face value, this appears to make sense. When drug cartels lose a major product like marijuana, they probably try to make ends meet through other means — and not just through other drugs but through human trafficking, gun running, extortion, and so on. It’s also likely that cartels did step up their heroin production as they saw the opioid painkiller and heroin epidemic grow in the US, since someone has to fill that demand.

Where Winslow’s theory collapses is timing. Take a look at this chart, which shows the rise of opioid painkiller and heroin deaths since 1999:

As the chart shows, the opioid painkiller epidemic picked up all throughout the 2000s. Heroin lagged behind as opioid users slowly shifted from painkillers to the more potent drug, but overdose deaths linked to heroin started to seriously pick up around 2011.

Now consider the timing of legalization. Colorado and Washington became the first states to legalize marijuana in 2012. Retail sales did not begin until 2014 — and Washington suffered from a big marijuana shortage for most of that year.

The timeline shows legalization couldn’t have caused the heroin epidemic. By the time Colorado shops began selling marijuana, heroin deaths had already hit more than 8,200 in 2013, rising from around 1,600 to 2,000 for most of the 2000s. The heroin epidemic was already well underway by the time legalization arrived.

Some states did legalize medical marijuana before all of this (starting with California in 1996), but that didn’t appear to have a huge impact on drug cartels’ finances. In 2010, the RAND Corporation estimated that as much as two-thirds of marijuana consumed in the US still came from Mexico. And medical marijuana patients only make up about 2.1 million of at least 33 million pot users in the US.

Besides, there’s a much simpler explanation for the heroin epidemic.

The simple explanation for the opioid painkiller and heroin epidemic

Here’s the quick summary: In the 1990s, doctors were under enormous pressure to treat pain as a serious medical issue — with good reason, as roughly one-third of Americans suffer from chronic pain, according to a 2011 report from the Institute of Medicine. With encouragement from pharmaceutical companies, they prescribed excessive numbers of opioid painkillers — getting a lot of people hooked on the drugs, and letting excess painkillers flood the black market. Opioid painkiller overdoses steadily increased, reaching epidemic levels by the 2010s.

Over time, these opioid users developed a tolerance and sought a better high. They turned to heroin, which has long been cheaper, more potent, and — especially after the government crackdown on painkillers to fight addiction — more available than opioid painkillers. As a result, heroin deaths rose. (A 2015 analysis from the Centers for Disease Control and Prevention found that people who are addicted to prescription painkillers are 40 times more likely to be addicted to heroin.)

It’s that simple. Doctors sought to treat a medical problem and turned to a risky drug (the evidence on whether opioids can treat chronic pain is shaky at best), and it led to a lot of unintended consequences. Marijuana legalization wasn’t a major player — it doesn’t even fill a void in our knowledge about the causes of the opioid epidemic, because we already know what happened.

If anything, marijuana legalization could help ease the heroin epidemic

The evidence actually suggests the opposite of Winslow’s claim: If laxer laws around marijuana had any effect, it was to weaken the opioid epidemic — and therefore cut down on the number of overdose deaths.

The idea: Medical marijuana is an effective painkiller for some patients, according to a review of the research published in the Journal of the American Medical Association. That means pot can potentially substitute for the type of opioid painkillers that have led to the current overdose epidemic. And since marijuana doesn't cause deadly overdoses, is less addictive than opioids, and isn’t linked to heroin use like painkillers are, replacing some use of opioids with pot could prevent some overdose deaths.

Several studies have backed up the idea. A 2015 study from David Powell and Rosalie Pacula of the RAND Corporation and Mireille Jacobson of the University of California Irvine looked at the effect of allowing medical marijuana dispensaries on opioid misuse and deaths. Powell and Pacula concluded, “Our findings suggest that providing broader access to medical marijuana may have the potential benefit of reducing abuse of highly addictive painkillers.”

A 2014 study published in JAMA found that medical marijuana legalization laws cut opioid overdose deaths, although it was less rigorous than Pacula and Jacobson’s analysis. And a 2016 survey from the University of Michigan found that chronic pain patients who used marijuana reported a 64 percent drop in opioid use.

So legalization didn’t cause the opioid epidemic, but it could help weaken its worst effects.