Meat, being high quality food, is a scarce resource in nature. The available amount of meat for any consumer is many orders of magnitude less than the amount of vegetation that is available. If you don´t believe me, just take a look out the nearest window and do a quick calculation over how much animal weight and how much tree or other plant weight you see out there. With notable exceptions such as my home area (where all you will see right now is a lot, and I mean a lot! of snow) and a camel market in the middle of a desert, meat will be extremely scarce and often not even around. Where I sit right now I see probably hundreds to thousands of tons of trees. I see one (very annoying) fly representing available meat.
Octopus are essentially soft globs of meat living in a world where meat in general is extraordinarily scarce and needed. Octopus will face a never-ending struggle to keep their meat to themselves, and not let anyone else use it for food. It is no wonder that octopus have a number of defenses to actually accomplish monopolizing their meat. Once being seen by a predator, octopus have several defenses. First of all they will try to escape, either by swimming quickly away from the predator or by getting into a small crevice or hole that the predator cannot penetrate. Second they can let go of an ink cloud in order to confound the predator, or, best-case scenario, have the predator attack the ink cloud as the octopus escapes. Third, some octopus can let go of limbs when threatened much like lizards loosing their tail, leaving the predator with a meal but keeping most of the octopus unharmed. Fourth, some octopus can use warning coloration advertising a highly venomous bite when threatened.
However, octopus go a long way to keep from having to use their active defenses. they do so by blending in in the environment, that is being camouflaged, in a way that is highly efficient and also very adaptive. One problem with using camouflage in general is that camouflage is site specific. Once out of the area the camouflage pattern is adapted for, the camouflage stops working. A Swedish soldier in his very efficient camouflage for Swedish winter conditions would, if transferred to tropical rainforest, stand out as a huge boil on the forehead of Naomi Cambell! As octopus are highly active, they have to be able to adapt their camouflage to changing environments, which they solve in a way very few other animals do.
Texture and color are the two major components of an environment that a camouflaged animal must handle. Octopus handle texture in an impressive way. They can change from looking like a smooth coral to a piece of broken rubble in a matter of seconds. They do this by using muscles in their outer layer of skin, using their very acute eyesight to map an exact picture of the surrounding environment in order to match the texture of the environment with that of the outer surface of the octopus. Some octopus can go from smooth to looking like a hairy piece of decaying sea floor in mere seconds.
Octopus are even more impressive when handling colour matching of the environment. First of all, their sense of sight is excellent, enabling the octopus to know what they have to match. Second, the outer layer of octopus skin has a number of different specialized skin cells, which can change the colour, brightness and reflectiveness of the octopus. These cells are under control of the nervous system of the octopus, enabling extremely fast responses to outer stimuli.
In this way, octopus and many of their allies can live their life being highly successful despite inhabiting a very dangerous environment.