Original: This phenomenon is called aposematism and works because predators learn by experience to associate certain prey phenotypes with a bad taste (or worse).
Simplified: This phenomenon is called aposematism and works because predators learn by experience to associate certain prey phenotypes (appearance) with a bad taste (or worse).