That's a vexing question. We don't know how it works.
Dr. Roger Hanlon commenting on the fact that cuttlefish are blind, and yet, though "they see the world without color ... their skin changes rapidly to any hue in the rainbow" when they apply their camouflage. As cited in Revealed: Secrets of the Camouflage Masters in this morning's New York Times.
Also vexing, according to Hanlon, is the "magical way" in which cephalopods -- the whole family of cuttlefish, octopi and squid -- apply patterns that are to scale with the environmental patterns to which they're trying to conform.
Hanlon and his team believe they've identified the three core variations that these tentacled creatures, whose "smart skin" is "all wired up" with a network of nerves that run from the brain to the skin, apply camouflage. Namely through variations in:
- Uniform color,
- Mottled patterns, and
- Disruptive patterning.
And of course you've heard about the cuttlefish who cross-dresses to get the girl »
Plus, more underwater biological goodness from David Gallo @ TED (and I'll spare you my memories of swimming in that bioluminescent bay in Vieques under moonlight. for now.)