Individuals differ. Offspring resemble their parents. More are born than can survive. None of those three is controversial on its own, and none of them is about evolution. Put all three together and the third one starts choosing which versions of the first get passed on by the second — and the population changes, without anything deciding that it should.
Every bar is a group of individuals with a similar value of one heritable trait — call it beak depth, or height, or how dark a moth is. The population starts spread around zero. The marker shows what the environment currently favours. Nothing has happened yet.
Each generation, individuals nearer what the environment favours leave more offspring — that is the whole of "selection", and it is a consequence of the fitness function, not a decision. The gap between the population average and the average of the ones that actually bred is S. How much of that gap the next generation keeps is set by heritability. Drag h² to zero and watch selection keep happening while nothing whatsoever changes.
Selection is a bias, not a guarantee. In a large population the bias wins because the noise averages out; in a small one the noise is the signal. Below, the same experiment run in parallel at four population sizes, with selection switched off entirely — so every wobble you see is pure accident. This is genetic drift, and in small populations it can fix a trait that selection was pushing against.
Now the same species in two places that want different things — a wet valley and a dry ridge, say — with only occasional migration between them. Each half tracks its own optimum. Turn the migration down and the two distributions pull apart until they barely overlap, which is how one population becomes two.
Nobody tells the population which way to move. Each generation the page computes a fitness for every individual from its distance to the optimum, samples parents in proportion to that fitness, and gives each offspring a mid-parent value regressed toward the mean by h², plus fresh environmental noise. The mean shifts because of what survives, not because anything was told to shift it.
You can check it against a result from 1937. Quantitative genetics predicts that the response to selection is R = h² × S — the change per generation is the selection differential multiplied by the heritability, and nothing else. That equation is nowhere in the code; it falls out of the sampling. The panel in step 2 compares the two live, and they agree to a couple of decimals whenever the population is big enough for the noise to average out.
What it leaves out: one trait, no genes as such, no linkage, no sex, no age structure, and an environment that never changes back. Real populations have all of those, which is why the field has more than one equation in it.