June 2016 - Opium comes from a kind of poppy flower that evolved around 100 million years ago in West Asia and Central Asia. People probably realized as soon as they got to West Asia, about 60,000 years ago, that you could use opium as a medicine. By 6000 BC, in the Stone Age, West Asian farmers were already growing opium in their fields, making opium one of the earliest domesticated crops. After the flower dies, a spherical seed pod forms under the flower (you can see the same thing on roses). If you make a cut in the seed pod, some goo oozes out - that's the opium. The plant produces this alkaloid for the same reason that other plants produce other alkaloids like nicotine, caffeine, cocaine, or quinine, to make the plant taste bad to insects who might attack it (or, possibly, to get bees addicted so they'll come back often and spread the plant's pollen).
Minoan goddess with a poppy
seed pod headdress
(Heraklion Museum, Crete, ca. 1300 BC)
In Bronze Age Greece about 1500 BC, paintings of poppy flowers on vases show that people were using opium at least as far west as Greece. In New Kingdom Egypt, doctors prescribed opium for infant colic. Greek doctors prescribed opium for pain, to stop bleeding, and to cause vomiting (to "clean you out"). By around 500 BC, doctors had brought opium as far north-west as Scandinavia and Britain, where Roman soldiers used opium in the 100s AD. Galen recommended opium to calm the cough of tuberculosis. By the time of the Islamic Empire, about 900 AD, the doctor Al Razi was using opium as an anesthetic so his patients wouldn't feel the pain of surgical operations.
Muslims arriving in India about 1000 AD brought opium there; Indian medical books from 1200 AD discuss the use of opium to control diarrhea (which works fine). Around the same time, traders along the Silk Road brought the first opium to China. The rulers of China soon made opium illegal there, fearing this foreign medicine. Meanwhile, people in northern Europe also stopped using opium, thinking of it as un-Christian because Islamic doctors recommended it. As a result, European people had no working anaesthetic to use for operations, and no way to deal with pain except alcohol: possibly the rapid spread of distilled alcoholic drinks like brandy and whiskey in the 1300s is related to this need. On the other hand, by the 1500s people were growing opium in India, and probably Indian traders had brought opium to East Africa too.
Learn by doing: go find some poppies to look at
More about opium: the Opium Wars