One of the first things you learn about evolution in school is that the human body has a number of 'vestigial' parts - appendix, wisdom teeth, tailbone - that gradually fell out of use as we adapted to more advanced lifestyles than our primitive ancestors.

But while our wisdom teeth are definitely causing us more pain than good right now, the human appendix could be more than just a ticking time bomb sitting in your abdomen. A new study says it could actually serve an important biological function - and one that humans aren’t ready to give up.

Researchers from Midwestern University traced the appearance, disappearance, and reemergence of the appendix in several mammal lineages over the past 11 million years, to figure out how many times it was cut and brought back due to evolutionary pressures.

They found that the organ has evolved at least 29 times - possibly as many as 41 times - throughout mammalian evolution, and has only been lost a maximum of 12 times.

"This statistically strong evidence that the appearance of the appendix is significantly more probable than its loss suggests a selective value for this structure," the team reports.

"Thus, we can confidently reject the hypothesis that the appendix is a vestigial structure with little adaptive value or function among mammals."

If the appendix has been making multiple comebacks in humans and other mammals across millions of years, what exactly is it good for?

Conventional wisdom states that the human appendix is the shrunken remnant of an organ that once played an important role in a remote ancestor of humans millions of years ago.

The reason it still exists - and occasionally has to be removed due to potentially fatal inflammation and rupturing - is that it’s too 'evolutionarily expensive' to get rid of altogether. There's little evolutionary pressure to lose such a significant part of the body.

In other words, the amount of effort it would take for the human species to gradually lose the appendix though thousands of years of evolution is just not worth it, because in the majority of people, it just sits there not hurting anyone.

But what if it's doing more than just sitting there?

For years now, researchers have been searching for a possible function of the human appendix, and the leading hypothesis is that it’s a haven for 'good' intestinal bacteria that help us keep certain infections at bay.

One of the best pieces of evidence we’ve had for this suggestion is a 2012 study, which found that individuals without an appendix were four times more likely to have a recurrence of Clostridium difficile colitis - a bacterial infection that causes diarrhoea, fever, nausea, and abdominal pain.

As Scientific American explains, recurrence in individuals with their appendix intact occurred in 11 percent of cases reported at the Winthrop-University Hospital in New York, while recurrence in individuals without their appendix occurred in 48 percent of cases.

Now the Midwestern University team has taken a different approach to arrive at the same conclusion.

First they gathered data on the presence or absence of the appendix and other gastrointestinal and environmental traits across 533 mammal species over the past 11.244 million years.

Onto each genetic tree for these various lineages, they traced how the appendix evolved through years of evolution, and found that once the organ appeared, it was almost never lost.

"[T]he appendix has evolved independently in several mammal lineages, over 30 separate times, and almost never disappears from a lineage once it has appeared," the team explains in a press statement.

"This suggests that the appendix likely serves an adaptive purpose."

Next, the researchers considered various ecological factors - the species' social behaviours, diet, habitat, and local climate - to figure out what that "adaptive purpose" could be.

They found that species that had retained or regained an appendix had higher average concentrations of lymphoid (immune) tissue in the cecum - a small pouch connected to the junction of the small and large intestines.

This suggests that the appendix could play an important role in a species' immune system, particularly as lymphatic tissue is known to stimulate the growth of certain types of beneficial gut bacteria.

"While these links between the appendix and cecal factors have been suggested before, this is the first time they have been statistically validated," the team concludes in their paper.

"The association between appendix presence and lymphoid tissue provides support for the immune hypothesis of appendix evolution."

The study is far from conclusive, but offers a different perspective on the hypothesis that humans have been keeping the appendix around for its immune support this whole time.

The challenge now is to prove it, which is easier said than done, seeing as most people who have had their appendix removed don't suffer from any adverse long-term effects.

But it could be that when people get their appendix removed, immune cell-producing tissues in the cecum and elsewhere in the body step up to compensate for the loss.

One thing's for sure in all of this - while we're probably not going to regain our tails, it's too soon to write off the appendix just yet.

The research has been published in Comptes Rendus Palevol.