Many animals feed on caterpillars as they are rich in protein. As a result caterpillars have evolved various means of defense. The appearance of a caterpillar can often repel a predator: its markings and certain body parts can make it seem poisonous, or bigger in size and thus threatening, or non-edible. Some types of caterpillars are indeed poisonous, and are capable of shooting acid.
Some caterpillars have long "whip-like" organs attached to the ends of their body. The caterpillar wiggles these organs to frighten away flies.
Caterpillars have evolved defenses against physical conditions such as cold, hot or dry environmental conditions. Some Arctic species like Gynaephora groenlandica have special basking and aggregation behaviours apart from physiological adaptations to remain in a dormant state.