In the case of the pipevine swallowtail, you are what you eat. In the caterpillar stage, the insect feeds on pipevine, which contains chemicals that make the adult butterflies taste awful to insect-eating birds.
Swallowtails are found throughout the Southwest. Adults dine on the nectars of a wide variety of common flowers, including azaleas, lantanas, verbenas, milkweeds, and thistles. Seen from above, this butterfly is attractive and distinctive, with blackish forewings and iridescent blue-black hindwings marked by a row of arrowhead-shaped white spots. But underneath, vivid spots of reddish-orange distinguish it from tastier species, warning away predators. At least six other swallowtail species have evolved to resemble the pipevine, capitalizing on its highly effective defense strategy. Birds that have learned to avoid pipevine swallowtails avoid these mimic species as well, even though they’re perfectly edible.
Even in the natural world, apparently, bad taste inspires copycats.