Everything that exists in the kingdom of living things has survived the sieve of natural selection, or it’s a maladjustment doomed to disappear in the short term. Good and evil, beautiful and ugly, adorable and hateful, compassionate and cruel, are all around us because they have been functional for the survival of their carriers (except in the case of maladjustments, ephemeral by their very nature, such as pointed before). That is, because they have made living organisms adapt to the evolution of the Universe, in turn determined by its initial state and laws. Emergent phenomena such as intelligence, consciousness, and morality are among the great works of a blind, unconscious and amoral natural selection that works simply by elimination: non-adaptive mutations are pruned without mercy.
In such a simple and even rough way, through a constant and merciless pruning of apparently random mutations, life advances in complexity. I say “apparently” because it could be that there was no randomness and everything was completely determined according to an initial state and certain laws. In that case nothing would be contingent but necessary, a result of the materialization of the only possibilities allowed. Because the Universe doesn’t allow for anything to happen (a hypothetical Multiverse comprising all possible universes would do, by definition).
The powerful principle of natural selection can be generalized to prebiotic realms, previous to life (also to higher-order emerging phenomena such as cultures or memes): molecular aggregates with the ability to reproduce themselves were selected, for obvious reasons, to the detriment of the rest. The principle could be applied even to universes: only self-consistent universes do survive, expand, and thus allow the emergence of life, intelligence and what might arise later. If so, not only would we be a living sample of three billion years of evolution but also of a very demanding prior selection of universes out of the infinite catalogue of Multiverse. A blind, unconscious and amoral race toward perfection (including moral one?), maybe from nothing.