We know that the universe was much denser and close together based on measurements, but cannot truly see the beginning. We think it’s most likely that the big moon in the sky most likely came from another planet hitting ours, but we don’t know exactly how the collision went down. Science is our best understanding, not some absolute source of knowledge. Our interpretations are often incorrect and updated accordingly, and even the most accurate theories are known to be an incomplete understanding. Until we understand everything, science is the search for knowledge, rather than knowledge itself.
Magic is just what you don’t understand. Everything is a mechanism. Even if there was magic, a human soul, the afterlife, God, it would still operate under certain logical rules and principles. Eventually, unless there was something keeping us from obtaining knowledge, we would be able to apply science to magical forces. Science will eventually understand everything it is possible to understand, which might honestly be everything.