Religion or "Religare" or "to reunite" with the spiritual world, or that to which Man has left is the ever going problem of Man.
Mankind ability to "think", although present prior to Grecian times, was really developed during the Grecian Epoch. This period of time lasted from about the time of Thales or the 6th century BC until the 15th century AD. this period of approximately 2100 years was preceded by what is known as the Egyptian/Chaldean/Hebrew epoch in which mankind's thinking ability was only in seed and therefore the idea of "Philosophy' which calls for "thinking and thoughts" is best known through the ancient Greek philosophers.
If there are written remnants of periods prior to the Egyptian epoch they were in some form passed on via speech and written at the Egyptian times or later in which we find the use of written language.
The epoch before the Egyptian is called the Persian cultural epoch and evident is the leader Zarathustra of the Persian peoples and in fact the Parsee Religion, present in India in our times (probably other places too) is directly descended form the teachings of Zarathustra (Zoroaster).
Prior to the Persian times the epoch of ancient India passed through but again the Vedas or Vedanta philosophy , as written today, are a marginal echo of the grandeur known to the ancient Indian.
In order
Ancient India
Persian
Egyptian/Chaldean/Hebrew
Greece/Rome
Present Era
Each of the eras lasted about 2100 years with "religion" not really evident until the Egyptian times as mankind was losing his "atavistic consciousness" to which he knew of and was ensconced within the spiritual world. there came a time in which this atavistic consciousness lacked clarity and one can say that "religion" began in which the religious attempted to "reunite" with the spiritual world, or that which was lost. this was accomplished through the "mystery centers" which were centers of religion, science and art.
Mankind precipitated further away from these spiritual realities and with the gaining of the intellect as evidenced within the Greco/Roman epoch we have Philosophy.
In our era the idea of a "spiritual reality" appears totally lost but whether one believe it or not, it is not forgotten. Our language is immersed within the earthly and science has taken the dogmatic approach thus stating that all knowledge comes through modern science . Modern science is a thought process brought forth by the Scholastics with the added impetus of an Islamic abstractionism , the root of present day science; the "dogma of experience".
Not to fret the future is the advent of "living thoughts" which "break out" of the abstracted shell and in essence this thinking which becomes alive is the reentry into the spiritual world; that to which the religions/mankind have sought and are seeking.
Its not a fight between religion, philosophy and science but more so an evolutionary progression within the evolutionary progression of Man in his soul qualities of thinking, felling and willing. Mankind precipitated to the earth during this progression but also gained an individuality or personality as in ancient times he was "within the spirit" sans individuality.
Because of this precipitation from his spiritual home he had reached the nadir of the earthly realm and the Christ Being came to the earth in order to lead mankind back to his spiritual home, just at the right time and place.
And almost forgot "Theology" is the intellectualized religion which quite often speaks to the dogmatic in religion. Religious "dogma" is the abstracted spiritual realities masked by the earthly or in other words "dead" with loss of creative life.