Eventually, the oo purposes served by religion came into conflict, causing "science" to split from "religion".
To communicate and enforce the "way of life" of a village, it was essential for myth to be a story that put the unverse into human terms that all could understand. But to enable engineering, it was essential for myth to be a story that successfully predicted the physical and chemical behavior of materials. Evolutionary "survival of the fittest" forces eventually resulted in myth that enabled engineering but had nothing to say about behavior or "way of life", and, worse, did not put the unverse into human terms so was not a story that all persons could understand. Science was born.