ELI5: In regards to mimicry in nature, how do the cells of an organism know what something looks like so that they can mimic it?

Depends on the animal but they see their surroundings and then consciously camouflage themselves.

For squid and octopus many thousands of color-changing cells called chromatophores just below the surface of the skin are responsible for these remarkable transformations. The center of each chromatophore contains an elastic sac full of pigment, rather like a tiny balloon, which may be colored black, brown, orange, red or yellow. If you stretched a dye-filled balloon, the color would gather in one spot, stretching out the surface and making the color appear brighter—and this is the same way chromatophores work. A complex array of nerves and muscles controls whether the sac is expanded or contracted and, when the sac expands, the color is more visible. Besides chromatophores, some cephalopods also have iridophores and leucophores. Iridophores have stacks of reflecting plates that create iridescent greens, blues, silvers and golds, while leucophores mirror back the colors of the environment, making the animal less conspicuous.

https://ocean.si.edu/ocean-life/invertebrates/how-octopuses-and-squids-change-color

/r/explainlikeimfive Thread