According to the CDC, narcotics originally referred to substances that numbed pain or otherwise dulled the senses. Over time, people began to refer to illegal drugs as narcotics.
To avoid confusion, “opioid” is the preferred term for pain-relieving drugs today.
Learn more about opioids as narcotics.