There are two main types of mimicry that involve resembling an unpleasant animal:
* Batesian mimicry: A harmless species evolves to resemble a dangerous or unpalatable species. This protects the mimic from predators who have learned to avoid the model species. A classic example is the viceroy butterfly, which mimics the monarch butterfly. Monarchs are poisonous to birds, and viceroys benefit from this association.
* Müllerian mimicry: Two or more unpalatable species evolve to resemble each other. This benefits both species because predators learn to avoid them more quickly if they only need to encounter one unpleasant species to learn the lesson. For example, many different species of stinging wasps have evolved to look very similar.
So, the adaptation where an animal protects itself from predators by looking like another unpleasant animal is called mimicry, and specifically Batesian mimicry when the mimic is harmless.