They grow best in poor, well drained soil (amazing how many British roadsides have swathes of pale lilac/white flowerd, come the end of June). Get caught cultivating the lilac/white flowered strain and it's not a happy ending. Luckily, garden centres carry an ornimental strain, with bright red, double petal flowers. Still get a decent yield of opium, when extracting from poppy straw (pods & stems) and it doesn't run the risk of setting off busibody neighbours, who would have recognized the lilac/white strain (just make sure the seeds are P. somniferum and not P. orientale, as they are the main form of poppies grown for their colour and appearance, but only contain the more exotic alkaloids, like thebane and oripavine. Great if you have a lab and the reagents/chemicals to make things like etorphine, but most don't!).
As to how they manage to get a precise morphine content, they assay raw opium, to determine morphine content, then add filler to achieve fixed percentage of morphine per gram (prepared opium). From then on, it's easy. Opium tincture is made using prepared opium.
Last little bit of info: opium poppies don't need any special conditions, to get good morphine yields (unlike weed, that involves using more electricity than most streets use), just enough water to prevent wilting and being planted at the correct time of year (best grown directly from seeds; they don't take well to being transplanted...)