How do camouflage crabs prevent from being eaten?

They look like their surroundings aka invisibility