There are a few possibilities for how the universe ultimately functions:
- Determinism - under determinism, every event is the direct-and-only-possible outcome of the causes that preceded it. Everything that is or occurs is ultimately due to the unfolding conditions initially set by the big bang. What set those conditions though?
- Stochasticism - everything is, at root, random. If QM effects don't directly impact the macro world (is an electrons "choice" of up or down spin a butterfly's wings upon the larger system it entangles into?), then at the very least the initial conditions of the Big Bang were randomly set.
- Super-determinism - not only is everything deterministic, but so are seemingly stochastic processes. Maybe there are infinite universes with every possible starting condition? Maybe every quantum event splits the multiverse onto various paths were each possible outcome is taken? (This is basically what I believe.)
- Will - there exists an object which can "choose" things without any calculation process. It simply "decides" something, but this isn't a random process. It will usually choose the same outcome giving the same coniditons, but not always so it isn't a purely deterministic object either. We have to treat this like an Oracle, that is mathematically, it's a thing that spits out answers but has no internal process we can understand. This object could be God (divine will) or something inside some or all acting beings in the universe (free will).
This problem with Will is that it's undefinable. Look at the axioms most mathematicians use: ZFC, the (Z)ermello-(F)ranco axioms plus (C)hoice. We can do math with or without Choice, both make sense, but we can't prove that you need it or not. And the axiom of choice is purist expression of Free Will that I know of: either you are allowed to have some undefined means of selecting one item from (possibly infinite) sets, or you must have a definite (calculable) means of choosing. Free will, or determinism? Even math can't decide!