Caterpillars are adapted for rapid growth. They have a small head, a small thorax and a LARGE abdomen that holds and processes a large quantity of food. Most of the inside of a caterpillar is the gut and it is typically filled with partly digested plants.
However, the legs of a caterpillar are attached to the 3 segments of the thorax which are small and scrunched next to the head. The legs are not sufficient to keep the abdomen of the caterpillar from dragging the ground or to provide a firm grip on a plant stem. To augment their diminished legs, caterpillars have extensions of the abdominal wall called “prolegs” to support the abdomen of the caterpillar.
In the photo below, you can see the catalpa hornworm supported by 3 tiny legs next to the head, 4 prolegs in the center of the abdomen and a 5th pair of prolegs on the last segment of the abdomen. The tiny legs can grip a stem and anchor the thorax to the plant while feeding. The prolegs have hooks called “crochets” The crochets dig into the plant and help the caterpillar climb the same way the spikes of a lineman help to climb a telephone pole. (The caterpillar crochets do less damage to a plant stem than a lineman’s spikes would do to a tree.)