Many prescription drugs and illicit substances are considered controlled substances. The federal government has classified controlled substances into five schedules based on how addictive they are and what kinds of medical uses they have.
Substances that are in Schedule I are always illegal because the federal government says that there aren't any true medical benefits to the substances. Two drugs that fall into this category are marijuana and heroin.
As you move down the schedule list, the possibility for addiction decreases and the oversight for the substances decreases. At the lowest end, Schedule V includes cough syrups that contain codeine since these might be abused by some people, but that abuse isn't likely going to be widespread.
When you are facing a drug charge, the schedule that the drug is in might have an impact on the type of charge you are facing, as well as the penalties that you are facing. For example, charges related to a Schedule I substances have stricter penalties than those related to a Schedule V substance.
The presence of a legal prescription can also have an impact here. For example, if your doctor writes a prescription for narcotics, you wouldn't get into trouble for having it as long as you do have a valid prescription.
As you prepare your defense, you need to think about how the schedule the drug is in might impact the case. From there, you can think about the circumstances associated with the charges. This might give you the basis that you need to formulate your defense strategy.
Source: FindLaw, "What Is a Controlled Substance?," accessed May 12, 2017