Short answer
Six legs allow for locomotion, while maintaining a supportive tripod at all times.
Background
There are several million species of insects, all on 6 legs. This implies that any change in this number is promptly selected against. It is generally agreed that insects were derived from many-legged ancestors, e.g. centipedes. The
One explanation is the tripod gait that results from having six appendages. This hypothesis, formulated more than 6 decades ago (Lanham, 1951), reasons that a reduction of the number of legs during evolution did not go further than 6, because locomotion of a small animal encased in a rigid exoskeleton is not effective with less than 3 pairs of legs. Insects generally walk by lifting the two outer legs on one side and the middle on the other side, sweeping them forward and placing them down together. Hence, insects support their rigid structures with a tripod at all times. Tripods are among the most stable configurations, and they never wobble (why on earth do tables have 4 legs?). Figure 1 shows an illustration of insect locomotion (Lanham, 1951).
Fig. 1. Insects' locomotion resembles a double tripod. Insects have a cyclic gait which consists of two phases, the stance phase and the swing phase. The stance phase is the power stroke, it pushes the body forwards in the direction of travel while the leg remains on the ground. Three legs are used is this phase by forming a tripod with the front leg and the hind leg on one side of the body and the middle leg on the other side. This formation is why this gait is known as the tripod gait. Source: Insect robotics.
Larger animals can afford to have less legs, because their vestibular systems have more time to maintain balance and adjust gait during locomotion. Because insects are so small, their strides are so quick that the nervous system may not be fast enough to deal with gait control. Instead, insects rely on the tripod gait to prevent any imbalance, rather than adjusting it. In addition, the exoskeleton effectively restricts small bodily movements to control balance. Larger animals such as mammals make small adjustments in their gait constantly to maintain balance. An insect has less opportunities to do so, because of their rigid exoskeleton (Lanham, 1951).
Reference
- Lanham, Science (1951); 113(2946): 663