Religion.
The explanation given in your question explains the meaning of Marx's famous line that "religion is the opiate of the masses." The full quote of what Marx said goes like this (in translation from the original German): ""Religion is the sigh of the oppressed creature, the heart of a heartless world, and the soul of soulless conditions. It is the opium of the people."
What Marx meant was that the promises of religion were used to keep the poor from fighting against the gross inequality that favored the upper classes. Religion taught them to put their hope in the next life rather than in this life. He compared that to the way a drug user (of a drug like opium) finds comfort and escape through drug use, even though the drug doesn't really solve the problems of his present life.