Why do animals have camouflage?

They have camouflage so they can be hidden from enemies.
They camouflage themselves to prevent from being seen by their predators or prey, so that they can avoid from being eaten or catch their prey.