Peristalsis is a series of muscle contractions and relaxations that occur along the course of the intestinal tract to push food and waste products through. In some cases, people can actually feel the contractions as they occur, especially in the case of movements of the large intestine. The basic principles behind this natural process in the body have also been adapted for peristaltic pumps, devices that utilize the same techniques used by the body to push fluids from place to place.
The way in which peristalsis works is fairly simple. When food or water enters the gastrointestinal tract, the muscles start to compress and relax in a wave-like motion to push the material through. In the case of someone swallowing a bite of apple, when the apple reaches the esophagus, bands of smooth muscle alternate squeezing and relaxing movements. As the muscle squeezes, the apple moves to the area where the muscle is relaxed, which will be further down the esophagus. The muscles further up stay contracted so that the food can't work its way back up, and eventually, the food reaches the stomach.
The stomach, in turn, forces its contents into the intestinal tract with peristaltic movements. The small intestines are constantly pushing material along so that it can be further broken down and digested, and to facilitate the expulsion of gas created as a byproduct of digestion so that the gas does not build up. By contrast, the large intestine goes through only two or three periods of big contractions every day, which are designed to push fecal material out of the anus.
This system is designed to prevent reverse peristalsis, in which food goes in the opposite of the desired direction. The body can sometimes have a wayward attitude, however, especially when it comes to getting rid of things which it deems harmful. Vomiting, for example, is caused by intense contractions of the abdominal muscles which push food back up through the esophagus, overriding the usual muscle movements.
People may sometimes refer jokingly to vomiting as “reverse peristalsis,” although this terminology is technically incorrect. Ruminants like goats and cows, however, do engage in this practice when they regurgitate cuds to chew on. In these animals, the digestive tract creates a vacuum that pulls partially-digested cuds into the esophagus, and then the animal uses muscle contractions to move the cud into the mouth so that it can be chewed again.