Francis Fukuyama in The Origins of Political Order: From Prehuman Times to the French Revolution draws a bright line from reciprocal altruism to abstract reasoning, and then through to religious belief:
Game theory…suggests that individuals who interact with one another repeatedly tend to gravitate toward cooperation with those who have shown themselves to be honest and reliable, and shun those who have behaved opportunistically. But to do this effectively, they have to be able to remember each other’s past behavior and to anticipate likely future behavior based on an interpretation of other people’s motives.
Then, language allows transmission of historical patterns (largely gossip in tight-knit social groups) and abstractions about ethical behaviors until, ultimately:
The ability to create mental models and to attribute causality to invisible abstractions is in turn the basis for the emergence of religion.
But this can’t be the end of the line. Insofar as abstract beliefs can attribute repetitive weather patterns to Olympian gods, or consolidate moral reasoning to a monotheistic being, the same mechanisms of abstraction must be the basis for scientific reasoning as well. Either that or the cognitive capacities for linguistic abstraction and game theory are not cross-applicable to scientific thinking, which seems unlikely.
So the irony of assertions that science is just another religion is that they certainly share a similar initial cognitive evolution, while nevertheless diverging in their dependence on faith and supernatural expectations, on the one hand, and channeling the predictive models along empirical contours on the other.