The ancients answered unanswerable questions by saying “God (or the gods) did it.”
Questions surrounding the mystery of why people got sick, comets flew inexplicably across the sky, and volcanoes blew their tops, and so on, were explained through an appeal to mythical and religious narratives. This appeal reflected the very human need to address uncertainty by exerting, however ineffectual, some modicum of control over the external world. Human nature has not fundamentally changed (so people continue resorting to magical thinking and metaphysical handwaving in the present day).
As it turns out, what the ancients lacked wasn’t control but knowledge and an effective methodology: they lacked the techniques, critical thinking, worldview and technology required to leave the safety of the cave and emerge into the light seeing the world as it is as opposed to how it ought to be.
Science, the scientific method specifically, reveals we get sick due to disease carrying pathogens (not demons); comets are not harbingers of doom but conglomerates of rock and ice orbiting the Sun with clocklike precision; and volcanoes don’t blow up because the god of the underworld demands a virgin as sacrifice (it erupts due to a series of naturally occurring geological processes).
Religion gave us formulaic reasoning like “God did it.” Not particularly informative or descriptive.
Science gives us dynamic reasoning like “X happened due to physical factor A, B or possibly C.”
Science has shaped us socially and morally, in that, we make moral decisions (in the West) based on appeals to experience and practicality rather than to prescriptions like the Ten Commandments; and socially we have, and continue to develop, new relationships with one another through rationality in the form of democratic institutions, the necessary separation of Church and State, and establishing societies governed through the rule of law (as opposed to the rule of caprice).