Looking out at the trail of devastation and death that the heroin epidemic has left in its wake, it’s hard to imagine that not long ago one could purchase the drug from a Sears catalogue.

Heroin was created by German chemists during the late 1890s and marketed through Bayer, the company best known for selling aspirin. For decades, suburban housewives could peruse pages of flashy advertisements for Bayer Heroin, the cure for sore throats, coughs, headaches, diarrhea, stress and menopause. In fact, until recently the percentage of Americans using opium-derived medicine was higher at the turn of the 20th century than at any other time in history.

The majority of illicit drugs we see today were once legal, popular and used for medicinal purposes. Cocaine made its debut in toothache drops marketed to children. Cannabis was recognized for its ability to relieve pain and nausea long before it became associated with youthful vagrancy.

As the world grapples with the fallout from the War on Drugs—and heads towards UNGASS 2016, a possible opportunity to put things right—it’s important to know the history of these drugs and their journey from medicine to menace. We didn’t suddenly discover that they were far more addictive or dangerous than other medicines. In fact, the reasons that drugs like heroin, cocaine, marijuana and others are illegal today have far more to do with economics and cultural prejudice than with addiction.

Heroin was the first to fall from pharmaceutical darling to a demonized, black-market street drug. Long used as a cure for aches and pains, it wasn’t until Chinese immigrants came to the United States to work on the railroads and mines that opium-based products such as heroin were perceived as dangerous. American settlers were not happy with the Chinese arrivals, who brought with them a cultural tradition of smoking opium for relaxation in the evenings. The settlers accused the Chinese of “taking our jobs,” and economic resentment morphed into rumors of Chinese men luring white women into opium dens and getting them addicted. Rumors turned to fear, which turned to hysteria, which politicians seized upon. In 1875 California passed the first anti-opium law, enforced by raids on Chinese opium dens. Other states soon followed. The first federal law regulating heroin was the Harrison Act of 1914, which eventually led to its criminalization.

Cocaine was criminalized for similar reasons, only this time the backlash was directed against black Americans. After the Civil War, economic resentment simmered over the freed slaves gaining a foothold in the economy. White Southerners grumbled about black men “forgetting their place,” and fears spread about a drug some of them smoked, which was rumored to incite them to violence. In the early 1900s New Orleans became the first city to slap down laws against cocaine use and the trend quickly spread, dovetailing with efforts in Latin America to criminalize the coca leaf, an ingredient in cocaine, which was used for religious purposes among indigenous populations.

Marijuana was next in the firing line. During the 1920s, tensions sprang up in the South over the influx of Mexican immigrants who worked for low wages. By the 1930s, the Great Depression had bred panic among people desperate for work and they directed their angst towards immigrants. The media began propagating stories about Mexicans and their mysterious drug, marijuana. The first national law criminalizing marijuana, the Marihuana Tax Act of 1937, passed thanks to a strong push from Harry Anslinger, head of the Federal Bureau of Narcotics, who referred to marijuana as “the most violence-causing drug in the history of mankind.”

While such claims of marijuana inducing violence may sound ridiculous to those of us who know marijuana as a drug that does precisely the opposite, it goes to show that the criminalization of drugs has little to do with relative risk or danger. Instead, the main impetus for criminalization is fear over certain groups seen as an economic or cultural threat to established America. Recognizing this fact does not mean ignoring or minimizing the very real harm that drugs can cause.

Most illicit drugs carry risks and serious potential for problematic use. But so does glue. So do gasoline, cough syrup, shoe polish, paint thinner, nail polish remover, cleaning fluids, spray paint, whipped cream cans, vanilla extract, mouthwash, nutmeg, prescription pills and countless other household items that are not only addictive, but potentially fatal if misused.

Scientists have now demonstrated that illicit drugs are pharmacologically equivalent to any other medicines on the market. We could easily declare OxyContin or Adderall illegal tomorrow, demonize the drugs and the people who use them, and in a few decades no one would remember that those street pills were once marketed by pharmaceutical companies and prescribed by doctors.

It was President Nixon who took these economic fears that had driven drug criminalization and turned them into masterful political opportunity. Elected shortly after the passage of the Civil Rights Act of 1964 and the Voting Rights Act of 1965, Nixon faced a large population of Americans who were fearful and angry about these reforms. A wily man, President Nixon knew that one of the best ways to gain political support was to turn the majority of voters against the minority using fear, false narrative, and the idea of moral or cultural inferiority. One of his first acts as president was to declare a War on Drugs despite the fact that drug use was not significantly worse than at any other time in history.

John Ehrlichman, White House counsel to President Nixon, captured the rationale behind the War on Drugs in an interview with reporter Dan Baum: “The Nixon campaign in 1968 and the Nixon White House after that had two enemies: the antiwar Left and black people…We knew we couldn’t make it illegal to be either against the war or black. But by getting the public to associate hippies with marijuana and blacks with heroin, and then criminalizing both heavily, we could disrupt those communities. We could arrest their leaders, raid their homes, break up their meetings, and vilify them night after night on the evening news. Did we know we were lying about the drugs? Of course we did.”

Witnessing the effectiveness of Nixon’s War on Drugs, other presidents in both political parties took up the mantle. Using an unparalleled influence over the media, President Reagan launched a period of mass hysteria over the drug du jour, which during the 1980s was crack cocaine.

Although studies showed white and black people using crack cocaine at similar rates, the media painted crack users as a black, poor, and urban. In less than a decade the US implemented some of the most draconian anti-drug laws in the world, all aimed squarely at the “crack-fiends,” the mothers of “crack-babies,” and others who were deemed criminal and worthy only of prison. The trend continued with George Bush and later Bill Clinton, who signed an omnibus crime bill in 1994 that included mandatory minimum sentences and federal three-strikes laws.

The US prison population swelled from 500,000 people behind bars in 1980 to 2.2 million by 2010—all with no change in the rates of crime or drug use. Such a hike was made possible by gutting social programs and reallocating the money towards law enforcement through a variety of incentivizing programs, including generous government grants, civil asset forfeitures, and donations of military equipment. Politicians benefited immensely, sweeping up votes with their “tough on crime” rhetoric and assurance that drug use was the result of moral bankruptcy.

Scientists have now confirmed that there is no such thing as a “crack baby,” only babies who are undernourished due to poverty, and crack cocaine is no different than its powdered form—except that smoking any drug creates a faster, stronger high than snorting it. But science and fact have little hold in a system driven by fear. Despite some recent criminal justice reforms, today we still warehouse more prisoners than any country in the world, mostly for drugs. We still arrest 1.5 million people a year for marijuana, 90 percent just for possession. Law enforcement has become so addictedto drug grants and drug money that it is hard to imagine scaling back to the pre-Reagan days. And every time a new drug is introduced, whether it be bath salts, K2, or even vaping, the old impulse to criminalize first, investigate later, still reigns supreme.

We have seen some bipartisan reforms lately and calls for treatment over incarceration. However these changes are hardly a cause to celebrate, not only because they barely scratch at the hide of the beast we have created, but also because we have not learned from our history.

Today, as always, the decisions over whether to help or imprison people who use drugs has more to do with the perceived users than with the drugs themselves. Drugs were legal as long as white, suburban housewives were using them to treat menopause. It was not until drugs became seen as the vice of poor or immigrant minorities that we decided to tackle the issue with guns, tanks and prison bars. We cracked down, criminalized and demonized the drugs—and by extension, the people who used them.

The calls for mercy and reform of today are happening at a time when drugs are once again perceived to be creeping into those suburban neighborhoods. Suddenly people in power have a family member with a pill addiction and white mothers across the land are weeping over the loss of their children. And while calls for treatment over incarceration may benefit all races (though not equally), by holding up stories of white straight-A students as reasons why we should go easy on drug addiction, we are using the same “deserving” vs. “undeserving” narrative that created the War on Drugs in the first place.

Without addressing the root cause of drug criminalization, it will take very little to turn back the narrative towards fearing, blaming and locking up whatever new minority we decide we don’t like.

This article was originally published by The Influence, a news site that covers the full spectrum of human relationships with drugs. Follow The Influence on Facebook or Twitter.