The origin, evolution and astonishing scale of the catastrophic opioid epidemic just got a lot clearer.

The drug industry — the pill manufacturers, wholesalers and retailers — found it profitable to flood some of the most vulnerable communities with billions of painkillers. They continued to move their product, and the medical community and government agencies failed to take action, even when it became apparent that these pills were fueling addiction and overdoses and were diverted to the streets.

This has been broadly known for years, but the more precise details became public for the first time in a trove of data released after a legal challenge from the Washington Post and the owner of the Charleston Gazette-Mail. The revelatory data comes from the Drug Enforcement Administration and its Automation of Reports and Consolidated Orders System (ARCOS). It tracks the movement of every prescription pill in the country, from factory to pharmacy.

"This really shows a relationship between the manufacturers and the distributors: They were all in it together," said Jim Geldhof, a retired DEA employee who is now a consultant for plaintiffs in a lawsuit against the drug industry. "It just reinforces the fact that it was all about greed, and all about money."

The industry has denied that, blaming criminal doctors and individuals who abused the drugs. The industry also contends that the DEA had all the information it needed to stop diversion of pills into the black market. "The DEA has been the only entity to have all of this data at their fingertips, and it could have used the information to consistently monitor the supply of opioids and when appropriate, proactively identify bad actors," said John Parker, spokesman for the Arlington, Va.-based Healthcare Distribution Alliance. The DEA declined to comment.

It appears that failures mark every point along the supply chain. The epidemic was not something out of sight. In full view, it intensified and the companies, health care professionals, law enforcement officials and government regulators were unable or unwilling to stop it.

"We have a tradition of trusting companies, and the [government] is kind of weak here," said Keith Humphreys, a Stanford professor. "Here it was misplaced trust."

The industry shipped 76 billion oxycodone and hydrocodone pills from 2006 through 2012, the period covered by the ARCOS data. They were distributed like a flash flood, spiking from 8.4 billion in 2006 to 12.6 billion in 2012. As a point of comparison, doses of morphine averaged slightly more than 500 million a year throughout the seven-year period, the data said.

The industry was supposed to self-regulate. Companies have an obligation, under the Controlled Substances Act, to report suspicious drug orders. The plaintiffs suing the drug companies allege that the incentive were tilted in favor of moving more product.

For example, the plaintiffs alleged that Ireland-based drug manufacturer Mallinckrodt gave the salespeople in charge of generic opioids "key roles" in investigating orders. Compensation "was weighted heavily to favor sales over compliance," the plaintiffs allege, adding that sales bonuses could exceed six figures.

Mallinckrodt said the company produced opioids only within a government-controlled quota and sold only to DEA-approved distributors.

The new details have made more nuanced and complex the narrative of the pharmaceutical industry's role in the drug epidemic. Many Americans knew about the role of Purdue Pharma, which in 1996 introduced the slow-release opioid painkiller OxyContin. Experts trace the epidemic to the appearance of Oxy, its heavy marketing, and its migration into the illicit drug trade along with other opioids.

The public's search for accountability has centered on Purdue and its owners, the Sackler family. But during the height of the crisis, from 2006 to 2012, Purdue's sales represented only 3% of the market.

At the top were generic drug companies many have never heard of: Actavis, now owned by Teva; Par Pharmaceutical, since acquired by Endo Pharmaceuticals of Ireland; and a generics subsidiary of Mallinckrodt, now known as SpecGx. They manufactured 88 % of the opioids in those seven years.

Several drug companies issued broad defenses, saying they were committed to providing a legal product to legitimate patients.

The new data shows that pills surged most dramatically into central Appalachia, particularly coal country, and bordering areas where the economy has been depressed.

Many people there have endured hardship and job injuries. Almost lost in the controversy is that some people need opioids badly.

In the 1990s, amid extensive drug industry marketing, the medical community seized on a big idea: that freedom from pain was a fundamental right.

Within a decade, the pills became their own self-sustaining industry, a black-market and even street-corner product. They arrived in bulk at small-town pharmacies. That trend is parallel to a rise in the death rates in those communities. Prescription opioid overdoses have killed more than 200,000 people in the U.S. since 1996.

The accountability question is now being played out in courts. The big event is in Cleveland, where a federal judge is overseeing about 2,000 separate lawsuits filed against a rash of drug companies. The outcome could be a massive, industrywide settlement along the lines of what happened with the tobacco industry many years ago. But the drug companies have denied wrongdoing.