For most animals, defence against predators is vital. Being eaten is not the only threat to life: parasites and diseases may also be fatal. But many animals are carnivores, and others, especially small animals, are often eaten.
Since life is about reproduction, anything that keeps a creature alive long enough for it to reproduce will be selected for. The next generation comes from the fertilised eggs of the previous generation.
Not surprisingly, then, animals have developed a wide range of defences against predation.[1][2] Some of these defences apply also to plants: herbivory on plants can be very damaging, and reduce a plant's fertility. Many plants have some defence against herbivores.