Endorphins
It was discovered in 1975 that the nervous system gives rise to compounds that alleviate pain. These consist of short chains of amino acids that seem to interact with the pain-receptors. Presumably, morphine and similar opiates work by mimicking the action of these substances, which are now called endorphins.