The octopus can change color because it has color grains (chromatophores) in its skin that are collected or dispersed by the muscles.