Anti-predator adaptations are mechanisms developed through evolution that assist prey organisms in their constant struggle against predators. Throughout the animal kingdom, adaptations have evolved for every stage of this struggle, namely by avoiding detection, warding off attack, fighting back, or escaping when caught.
The first line of defence consists in avoiding detection, through mechanisms such as camouflage, masquerade, apostatic selection, living underground, or nocturnality.
Alternatively, prey animals may ward off attack, whether by advertising the presence of strong defences in aposematism, by mimicking animals which do possess such defences, by startling the attacker, by signalling to the predator that pursuit is not worthwhile, by distraction, by using defensive structures such as spines, and by living in a group. Members of groups are at reduced risk of predation, despite the increased conspicuousness of a group, through improved vigilance, predator confusion, and the likelihood that the predator will attack some other individual.