In order to survive, early man had to learn a great deal about his natural environment. At the same time, his complex brain led him to imagine gods who protected him from the many dangers that he faced (storms, predators, drought, hostile clans) and who provided the means for his survival. For most of human history (which covers 130,000 years), factual knowledge and religious mysticism were intertwined and both evolved in concert; indeed, ritual became an important element of human culture, a means to appease the gods that ensured our welfare.
The relationship between our factual knowledge of nature and our religious beliefs would remain unchanged until a scientific revolution spread through human civilization, some 500 years ago; this offered the means (the scientific method) to scrutinize the assumptions that governed our view of this planet, its life forms and the celestial bodies that fill its skies. As the advance of science began to conflict with religious doctrine (especially in the fields of astronomy, geology and evolutionary biology), the gap widened and powerful religious organizations launched efforts to derail scientific progress. Despite their attempts, our scientific knowledge has continued to advance while religious doctrine stopped evolving centuries ago.
Yet, the war between science and religion persists and scientific education is threatened, especially at the grade school and high school levels. Many humans gladly accept the benefits of modern science (especially in the fields of medicine and technology) while retaining religious beliefs that offer a simplified version of natural history and of our place in the Universe. Whether humans evolve beyond our need for religion remains to be seen; for now, fear, guilt, ignorance and political pressure ensure its potent role in human society.