Religion remains the oldest illusory institution known to our species. Before there were cities, economies, or governments, there was a human need to seek out what it was that created and sustained it.
Our species, being an inquisitive, intelligent, and outgunned species, sought answers to the phenomenon we observed in the cosmos. Our early ancestors faced death, disease, natural catastrophe, and predators. This incredibly scary world mixed with an increasingly conscious mind needing to make sense of their surroundings if only for comfort. Simplistic "religions" were formed to give praise to what was most important to survival. At first it was bison, elk, and deer but eventually, with, the agricultural revolution, the Sun came to the center stage.
Religion was initially a symbol, but right around the time inequality was introduced into human society religion became a means of control. Humanity had been egalitarian for 95% of its history until, circa 6,000 years ago, food surpluses allowed for the first cities to be created. Within these cities chieftains became dictators taking the majority of the surpluses and goods for themselves. To protect themselves, they hired others to protect them and in return shared the bounty with their guard.
But muscle was only good so long as it could be flexed and muscle tires, fatigues, and can betray its master. In order to keep those closest in line and to place fear in the hearts of the people, the leaders of these Neolithic towns turned to the gods (or at least the priest class turned to the leader to offer their services). With the gods on the side of the leader, to turn against him would insure that the crops would not grow, storms would envelop your home, and your children would die. The gods were only sated if the rules of the priests were followed and rule number one was that the leader was placed there, even conceived their, by the gods themselves.
This mindset entered Western thought when Alexander was declared a god after the "liberation" of Egypt from Persia in 331 BCE. Thankfully this line of thinking was abandoned in the West after the rise of the Roman Empire (149-146 BCE) but would be reinstated by that same empire during the rule of Constantine the Great (312-337). Suddenly kings and monarchs ruled by divine right and the Pope was the living embodiment of Christ on earth. The last bastion of hope against religious tyranny was lost giving birth to the Dark Ages, the Crusades, the Inquisition, the Salem Witch Trials, and centuries of religious wars, oppression of women, slavery, and hatred.
That is until the Classical Age was rediscovered, Galileo looked through two pieces of glass, and the French Revolution left Louis XVI's divine righted head in a basket.
For four hundred years science and philosophy have fought to enlighten humanity to the truth of the Universe. Nevertheless, Religion holds tight, utilizing government and economics to keep the majority of the population stupefied and ignorant. But we have entered a dangerous time. A time when religious fundamentalists who seek the death of the infidel and themselves, exist simultaneously with weapons of mass destruction.
The 21st century will determine the fate of humanity and there is no clear marker that states that the reality of the Universe will win over the illusion of Religion.