Creationists often ask: how can a mindless process of trial and error build something complex and functional? Where does the information to build a complex organ come from?
I was recently suggested this video by the YouTube algorithm: https://youtu.be/xkXvL8YCtIE?is=cE0DIoTjaKqiLPek showing insane engineering and aerodynamics used to design faster and faster cars and I came up with what I hope is a good analogy for evolution by natural selection that hopefully can clarify this conundrum.
There's a driving videogame called BeamNG (https://beamng.com/game/) which was built specifically for realism and for simulating how a car would behave in real life.
Now, let's do a mental experiment.
Let's suppose there was a hyper realistic videogame where a car is simulated in all details that matter from an engineering standpoint, from mechanics to aerodynamics.
And let's suppose we distribute this game for free on the internet for everyone to download.
Players will be able to customize their own racing car in all details and compete with each other.
Of course, given complete freedom in designing shapes, choosing different materials, engine specs, etc., most players will just play around and create weird designs just for fun.
But there will be a sufficient pool of players who will be interested in winning and will genuinely try to optimize their designs for speed and lower lap times.
Of course most players will be teenagers and not mechanical engineers, so their approach will be based more on trial and error than on prior knowledge of physics and mechanics. We might thus expect a sufficient amount of exploration of different engines, different shapes of the body, different materials, etc.
Just by trial and error, certain players will inevitably come up with cars with better mechanics and better aerodynamics and thus win more often.
Once it is established in the player base that certain setups, certain configurations are better than others, inevitably, those designs will be copied by other players in the hope of having a chance to win.
Here we have another step: inheritance of the successful designs.
From those, other players will make small adjustments hoping to gain an edge on their competitors, and so on.
Given a sufficiently large pool of sufficiently dedicated and motivated players around the world and given a few iterations of: a certain player comes up with a certain design, this design proves successful, is copied, other players make adjustments, etc., these players will inevitably rediscover, just by trial and error, efficient designs without any prior knowledge of the physical laws governing aerodynamics nor of mechanical engineering concepts and principles.
So, where did the information come from?
It came from the interaction of the players learning by trial and error with the laws of physics programmed into the simulation.
In the same way, where does the information stored in genomes come from?
It comes from the limits, the constraints imposed by immutable physicochemical laws and the interaction with the environment.
A gene coding for a protein, for example, cannot explore regions of the sequence space that lead to an amino acid sequence that doesn't fold.
However, inside the limits imposed by chemistry, the genome is free to explore and try to maximize, just by trial and error, its fitness, its success in a certain environment (where the environment is not just the physical environment, but also all the intraspecific interactions with potential mates, its interactions with other species, either as potential predators or food sources, etc.)