Opioids are a class of drugs that derive from, or mimic, natural substances found in the opium poppy plant. Opioids work in the brain to produce a variety of effects, including pain relief. As a class of substances, they act on opioid receptors to produce morphine-like effects.