Legal marijuana will poison children and cause more Arizonans to die in car crashes, according to scary television and online ads running across the state in advance of Election Day.

"Edibles that look like candy, marketed to kids," warns one ad, with a voiceover meant to sound like a concerned mother. Other spots feature school principals and public officials from Colorado explaining why they believe legal weed has been a bad deal for their state. "Don't repeat our terrible mistake," says Wellington Webb, a former mayor of Denver.

The ads were created by Arizonans For Responsible Drug Policy, a group that's encouraging voters to reject Arizona's Proposition 205, which would allow people aged 21 and older to possess up to an ounce of marijuana and grow up to six plants in their own homes. Arizona is one of four states—along with California, Massachusetts, Maine and Nevada—that could vote to legalize recreational weed on November 8.

Despite the voices and faces in the ads, though, Arizonans For Responsible Drug Policy and similar groups urging "no" votes on marijuana legalization in other states are not funded by concerned parents and public officials. In large part, these groups are funded by pharmaceutical companies trying to protect their share of the market for painkilling drugs—and in Arizona, the biggest donor to the "No On 205" campaign is a company that's been investigated for its role in overdose deaths.

That company, Arizona-based Insys Therapeutics Inc., is best known for manufacturing a pain relief spray that contains fentanyl, an opioid that's been under heightened scrutiny for its role in several overdose deaths, including the high-profile death of Prince in April. As Reason previously covered, Insys Therapeutics in August made a $500,000 contribution to Arizonans For Responsible Drug Policy, the largest donation the group has received from a single source.

It's not just happening in Arizona. According to a report from The Nation, Purdue Pharma and Abbott Laboratories, makers of the painkiller OxyContin and Vicodin, respectively, are among the largest contributors to the Anti-Drug Coalition of America. Meanwhile, the Pharmaceutical Research and Manufacturers of America, which advocates on behalf of drug companies, spent nearly $19m on lobbying in 2015, according to a report from The Guardian, which called PhaRMA "one of marijuana's biggest opponents." Federal lobbying data aggregated by Maplight shows that PhaRMA has spent more than $150 million on lobbying since 2008—a total that only includes federal lobbying efforts, not similar work done in state capitals, where PhaRMA is also active.

These companies and organizations are allowed to spend their money however they want, of course, including trying to influence the outcomes of elections. That's the beauty of living in a free country. Still, it's worth asking why they would be so keen to spend millions of dollars fighting marijuana legalization.

One big part of the answer is that states with legal marijuana—medical or recreational—have lower rates of drug prescriptions.

Ashely and W. David Bradford, a daughter-father pair of researchers at the University of Georgia, quantified the relationship between legal pot and prescription drugs in a study published earlier this year. They analyzed state-level prescription drug databases from 2010 through 2013 and found that doctors prescribed significantly fewer pharmaceutical drugs in states with legal medical weed.

The largest drop-off was for prescription pain-killers (with 1,800 fewer doses prescribed annually in states with medical marijuana laws), like the one made by Insys Therapeutics, but the Bradfords found a significant declines in prescriptions to treat depression, anxiety and seizures.

"The availability of medical marijuana has a significant effect on prescribing patterns and spending in Medicare Part D," the Bradfords wrote. States with medical marijuana laws saved $165.2 million in Medicaid costs during 2013, they said.

Savings to a state is lost revenue to a drug company. No wonder Insys and others are willing to spend so much to keep marijuana illegal in is many places as possible.