Defensive or protective mimicry takes place when organisms are able to avoid encounters that would be harmful to them by deceiving enemies into treating them as something else. The first three such entail mimicry of organisms protected by warning coloration: Batesian mimicry, where a harmless mimic poses as harmful; Müllerian mimicry, where two or more harmful species mutually advertise themselves as harmful; and Mertensian mimicry, where a deadly mimic resembles a less harmful but lesson-teaching model. The fourth case, Vavilovian mimicry, where weeds resemble crops, is important for several reasons; and humans are the agent of selection.
So by pretending to be something else, these organisms (often insects) avoid being eaten.