M'amn, you just asked a drug question to someone who knows way too much about this stuff, so be prepared for more information than you probably care about!
The flower
papaver somniforum, commonly known as the Poppy, is commonly grown as an ornamental plant in the US. In other parts of the world, they are grown at huge scale as a cash crop, because they contain the drugs morphine, codeine and several other active compounds.
The earliest narcotic drugs were just crude extracts from the poppy plant, called Opium. In the 1850s or so, the Bayer corporation figured out that you could chemically modify morphine by adding two acetyl groups to it, making diacteylmorphine, which they named "Heroin" because it made users feel "heroic". Somewhat ironically, Heroin was originally marketed as a
less addictive version of morphine, because some people theorized that because it was much faster acting, and much more potent, it might be less likely to lead to dependence. Of course the reverse was true: the fast action created tolerance even quicker, and the potency meant people got higher off of it.
By the 1920s, there was sufficient backlash that heroin became an illegal drug in the US, and in the 70s, the Controlled Substances Act explicitly lists all parts of the poppy plant (except the seeds, which are used in food like poppy seed bagels) as a controlled drug.
Narcotic painkiller drugs fall into two different groups: drugs which are derived in some way from poppies, including morphine, codeine, heroin, and then the more chemically complex newer drugs like oxycodone, hydrocodone and oxymorphone. These drugs are commonly referred to as
opiates, because they are derived from the opium poppy. On the other hand, there is also a group of drugs which are synthesized from the ground up, but are
structurally similar to morphine. Meaning, if you could look at the molecules themselves under extreme magnification, they are the same basic "shape", so when they enter the body, they will bind to the same neuron receptor sites as morphine does. These drugs are commonly referred to as
opioids, and this includes Tramadol, Fentanyl, and a bunch of other things I'm forgetting. There are also some weird cases like the antidepressant Tianeptine: this is a tricyclic antidepressant, which works in the same way that the other TCAs like Mirtazepine do... but it
also has a structural similarity to morphine, and in high doses, it will act like an opiate, as well.
The chemistry here is really, really interesting to me. For instance, it was long assumed that morphine worked because it happened to be similar to pain-relieving compounds that occur naturally in the human body, "endorphins" (the etymology of that word literally meaning, "morphine-like substance produced naturally by the body"). But, fairly recently, it's been shown that morphine itself is synthesized inside mammals (in doses far lower than what you'd get if you took a pill, of course).
That's more or less all off the top of my head, so I may be slightly off in some of my dates, but you get the gist of it.
You can sometimes buy dried poppies in crafting stores, because people make wreaths out of them. You can also brew tea with dried poppy pods and make a very crude narcotic tea; this is very illegal in most countries. So, there's a sort of weird set of legal concerns around all this stuff. Poppies are probably a much more problematic plant than marijuana, and yet are grown legally for ornamental reasons. Somehow "ornamental marijuana plants" have never really been a thing
It's a shame, really... I think all plants are beautiful! Some of them are just nice to look at, some of them have useful drugs in them, and some of them are
very pretty and
very deadly, like Angel's Trumpet... but I digress.