You pick up the flashy toys the most. The more they get used the faster they break. Only the toys that are “harder” to see last longer.
Replace toys and color with predator/pray animals and their camo coloring. Harder to spot, don’t get eaten. Live long enough to have babies. Teach them where to hide, and rinse and repeat until perfection.
They all looked different, the ones that didn’t look so similar to their environment were extra good at dying, and thus extra bad at having babies that looked like them. So the more you happened to look like your environment, the more likely you were to survive long enough to have babies that looked like you. Rinse and repeat
It’s not a matter of “knowing what to mimic” it’s more natural selection at work. If a butterfly is red on a green leaf it’s rather easy for predators to see.
Those who mutated more green had a bigger chance at survival.
The same goes for shapes. A leaf shaped wing is harder to make out than wings that aren’t.
Why are there sharply colored butterflies then if they are easier to see for predators then?
Well a potential partner has the same problems a predator has. Here it’s the procreation of the species that has won in the grabs evolution.
Imagine a bush full of bugs that aren’t very well camouflaged. The bugs that look the least like the leaves they are on are more noticeable and get eaten first, meaning the bugs that blend in a bit better are the ones that reproduce.
Their babies vary in shape and color, some becoming slightly more like the leaves and some sightly less
Again the ones that look least like the leaves hey eaten first.
Repeat that millions of times and you get extremely good camouflage. And the bugs themselves never knew what to camouflage themselves as, it was the animals eating the bugs that “told” them how to look by not eating the best camouflaged ones.
They don’t know what to mimic. Many generations of insects have been born, lived, and died. Many millions of generations.
The ones who happen to do a better job at camouflage live longer and have more babies.
They pass on the genes for their type of camo.
The ones of the babies who do a better job also live longer and have more babies.
Do that a few million times and you have a bug that lives among dead leaves, that looks almost exactly like a dead leaf.
Let’s pretend you’re an animal that eats bugs.
Do you see all the green bugs hiding in the grass? No?
How about all the purple bugs hiding in the grass? Yes?
Boom, you eat all the bugs you can see. Which happen to be the purple ones and you leave the green ones alone.
Now there are only green bugs left hiding in the grass. Voila! Camouflage.
It’s natural selection mixed with organisms that have relatively small generations and there for more chances for mutation. Before an environment changes. This allowed them to be very specific. Evolution arises from random mutations. If the mutation happens to benefit the organism the new trait will be passed on. In the case of insects, they have many eggs and their generations go by much faster than other organisms. This gives them a much greater incidence of mutation, and that means they can respond to the environments they live in fairly fast relative to say mammals. Overtime, this can lead to extreme specialization.
Latest Answers