Although one butterfly will be killed from such an encounter, many more will live. Good tasting butterflies are butterflies that, when eaten, are agreeable with the consumer and most defend itself accordingly. There are two ways to do it. To be good tasting and bright is dangerous for an appetizing butterfly. Therefore the good tasting species camouflage themselves by being dull colors.
Mimicry is another effective defense.
It is used by brightly colored species that are also good tasting. Their bright color patterns have evolved to appear like those of the poisonous butterflies. One example is the orange and black colored Viceroy which is strikingly similar to the poisonous Monarch. A predator that's experienced a monarch would never again venture consuming another orange and black specimen. Female butterflies are programmed to know where and when they will lay their eggs.