The function of the appendix, known more formally as the vermiform appendix, is a topic of debate in the medical community. Some clinicians and scientists believe that it is a vestigial organ, a remainder from a time when humans ate a diet high in cellulose and needed assistance with digestion. Others argue that the organ actually serves several important functions in the body related to the immune system. Physicians err on the side of caution today, only removing the organ in situations where it is medically indicated instead of routinely removing it during abdominal procedures as was once common.
As the name implies, the vermiform appendix does indeed look like a small worm attached to the cecum, a pouch that joins the large and small intestines. It shows up relatively early during embryological development and appears to secrete hormones that may play a role in maintaining homeostasis in the developing fetus.
In adults, the appendix contains lymphoid tissue and it has been linked with immune function. Some researchers suggest that it is involved in storing and presenting antigens to the immune system so that it can detect the difference between friend and foe in the gut. The gut is exposed to a wide variety of substances, making it critical to keep the immune system constantly updated so that it does not mistakenly attack beneficial foods or bacteria. This organ, along with other structures like Peyer's patches, may be involved in local immunity for the intestines.
Studies on this part of the gut anatomy have shown that it also may serve as a storing place for beneficial gut flora. When people are sick and the gut is cleaned out with bouts of diarrhea, probiotic bacteria may be trapped in the appendix. Once the person recovers, the bacteria can be released to repopulate the gut and allow the patient's digestive tract to return to normal. Such bacteria are an important part of digestion and there is some logic in the suggestion that the body would want to create a reservoir to store them.
Another function of the appendix is one that was not evolutionarily intended: it can be used as a replacement bladder. If the healthy organ is left intact, it can be recycled in the event that a patient develops bladder disease. The appendix has also successfully been used to make a stand-in for a damaged ureter. While the other functions that have been proposed to explain this organ may be subjects of debate, the surgical utility of the appendix is undeniable.