The most obvious reason such a soft-bodied animal would change color is to hide from predators—and octopi are very good at this.
They can change not only their coloring, but also the texture of their skin to match rocks, corals and other objects in their surroundings. They do this by controlling the size of projections on their skin (called papillae), creating textures ranging from small bumps to tall spikes. The result is a disguise that makes them nearly invisible; can you even see the octopus in the video above? Color changing is just one tool in an octopus’s arsenal of defenses, however; it can also spray ink, and make a quick escape through any hole it can get its hidden bony beak through.