These eyespots make the insect look like the face of a much larger animal and may scare away some predators. Hiding Some caterpillars encase themselves in a folded leaf or other hiding place. Bad smells Some caterpillars can emit very bad smells to ward off predators. They have an osmeterium, an orange, y-shaped gland on their neck which gives off a strong, unpleasant odor when the caterpillar is threatened. This keeps away dangerous wasps and flies that try to lay eggs in the caterpillar.
Many swallowtails have an osmeterium, including the Zebra Swallowtail .
Legs Caterpillars have two types of legs which perform different functions. Caterpillar's thoracic legs hold onto its food. The prolegs are stumpy legs that let the caterpillar climb very well, even up vertical surfaces. Caterpillars usually have five pairs of stumpy prolegs on the abdomen. These prolegs disappear in the adult.