Share All sharing options for: Painkillers now kill more Americans than any illegal drug. Watch why.

It's a terrifying fact: More than 47,000 people in America died of drug overdoses in 2014 — in what's been widely called an epidemic.

But the biggest killer of this epidemic isn't cocaine, meth, or even heroin; it's totally legal opioid painkillers. Here's how it happened:

Since the 1990s, doctors have been under more and more pressure to treat pain as a serious medical issue. Pharmaceutical companies took advantage of this desire, marketing opioid painkillers like OxyContin and Vicodin as a safe, effective solution to pain.

The result: Millions of Americans got hooked on the drugs, and tens of thousands have died from overdoses. In 2014, nearly 19,000 died from overdoses linked to opioid painkillers.

What's worse, as doctors have pulled back on painkillers to halt the epidemic, users have gone to another opioid — heroin. In 2014, more than 10,000 people died from overdoses on that drug as well.

In response to all of this, the Obama administration and other levels of government have stepped up funding for treatment and prevention — and experts agree this will help many of the people currently struggling with addiction.

But fundamentally, doctors still need a way to treat pain. Opioids haven't worked out, causing an urgent crisis instead. One solution, then, is medical marijuana, which studies have shown to be effective at treating chronic pain and averting opioid deaths. It's not a perfect solution, and it won't work for every patient, but it might be one stopgap as this epidemic continues taking tens of thousands of lives.