Opiates in mother’s milk (they are found in milk from all species) calm the baby, which is perhaps why nature designed them to be there in the first place. With the baby associating the mother with an addictive, pain-releiving food that has a drug-like effect on the baby’s brain, the mother-child bond is strengthened and the continued nursing ensures the baby gets all the nutrients they need to survive and grow.
Casein, a protein in milk, breaks apart during digestion to release a swag of opiates called casomorphins, one of which has about 1/10th the pain-killing potency of morphine. The casein fragments that pass into the human bloodstream from dairy products reach their pain-releiving, drug-like peak about 40 minutes after being consumed. The casein in cow’s breast milk is much more concentrated than the casein in human breast milk, and cheese contains far more casein found in milk from either cows or humans. Cheese also contains an amphetamine-like chemical called PEA (phenylethylamine). But having said that, chocolate contains 10x as much!
The mother’s milk of all mammals is species specific: designed specifically for the babies of that species (rather than some other species). When a human breastfeeding mother drinks cow’s breast milk, some of the cow-milk caseins pass from the human mother’s digestive system into her bloodstream and then into her own breast milk, in amounts large enough to irritate the baby’s stomach, thus causing colic.
Like heroin or codeine, casomorphins have an antidiarrheal effect because they slow bowel movements, which might be why cheese is constipating for so many people. With lactose (the sugar in milk) being difficult to digest and often resulting in diarrhoea, you would hope the two might cancel each other out, but the effect can be more erratic, unfortunately! A little irritable-bowelish: runny one minute, blocked up the next, with all sorts of bloating and smelly wind to cap it all off.
Reference: “Breaking the Food Seducation: The hidden reasons behind food cravings- and 7 steps to end them naturally” by Neal Bernard MD