The coyote learns to associate the color of the snake with injury. The next time the coyote encounters a coral snake, it will avoid interacting with the snake, saving itself pain, and saving the snake from harm as well. Clearly, both the coyote and the snake benefit from the snake's coloration. While this is all well and good, being brightly colored has its disadvantages. Imagine being brightly colored like the coral snake, and trying to catch and eat an animal that sees color very well.
Some animals rely on cryptic coloration to conceal themselves from their prey.
They lie in wait, practically invisible because of the way their coloration blends into their surroundings. When the appropriate prey species blunders by, these ambush foragers burst out of hiding to capture their next meal. The rattlesnake is just such a creature. Rattlesnakes have very cryptic coloring, which hides the snake not only from potential food items, but also from potential predators like hawks, roadrunners, coyotes, and people. The rattlesnake's most typical behavior is to lie motionless, using its coloration to conceal itself, until potential threats pass, or potential food items come within striking distance.