Caterpillars can be a bit “touchy”. Touching a caterpillar gently on its abdomen can elicit a “striking” behavior in which the caterpillar rapidly contorts its body and snaps at the point of contact with its mandibles. I once did a youth program that included both blowflies on sticks and caterpillars. The youth, paying more attention to their caterpillars than yours yours truly, found that touching the legs of the blowfly to the back of a caterpillar elicited a rapid strike response. The caterpillars respond just as well to a dead fly as a live one and will respond similarly to other types of contact.
The strike response is a defense against attack by insect predators and parasitoids. In nature, parasitoids are a major mortality factor for caterpillars. Deterring or even killing the parasitoid is an advantage to the caterpillar. The strike behavior is a reasonably good defense. Scientists who grow the parasitoid, Cotesia, in the laboratory have found that immobilizing the larva so it cannot strike will decrease mortality of the parasitoid adult and increase the rate of parasitism.There are a lot of questions concerning how a caterpillar directs its strike and the accuracy. Griethuijsen and colleagues have found that the accuracy depends on the location of the “attack”. Strikes directed toward a touch on the posterior abdomen were more accurate than strikes directed toward the anterior portion of the abdomen. The process that caterpillars use to direct their strike is a mystery, especially with regard to the receptors and signals that the caterpillar utilizes. Understanding the guidance system may have practical applications for robotics.
*Spatial accuracy of a rapid defense behavior in caterpillars. Linnea I. van Griethuijsen, Kelly M. Banks and Barry A. Trimmer. J Exp Biol 216, 379-387. February 1, 2013