Get a modern text book on biochemistry, and another on computational theory, and start reading.
There seem to be an infinite class of possible causes of variations, chemical, behavioural, environmental, in any and all combinations.
It is still a matter of great debate as to what is the fundamental nature of such variation.
Is there actual randomness present in reality or is all the variation the result of some fixed but hidden deterministic pattern?
To me, the answer to the latter question seems, on balance of probability, to be most likely to involve fundamental randomness at some level, though always in a balance with more ordered systems.
It does seem that in such a universe, that is a fundamental balance between order and disorder, that evolution can recursively explore that boundary region between order and chaos, and individuals with the sort of complexity we have can develop very high degrees of free will.
And the balance between order and chaos is very important to evolution – all levels (atomic, molecular, cellular, multicellular individuals, populations, ecosystems, social, cultural, abstract intellectual, etc).
Too much order, and there is insufficient variation in a population to survive the changes in environmental context that happen from time to time.
Too much chaos and the boundaries necessary to sustain the levels of complexity present cannot survive.
So survival for all life, all levels, seems to be an eternal exploration of those (and other) orthogonal sets of threats and possibilities.
Quantum mechanics seems to hint at (though not prove) that such a balance may be present at the level of the fundamental entities that make up all that we call matter and energy.