It is involved in immune functions. It has a lot of lymphoid tissue in the submucosa so it helps the maturation of B lymphocytes and the syntesis of IgA.
Generally it is a vestigial organ but is sometimes involved in immune functions
Ancient times in the beginning when the human didn’t discover the fire and used to eaten unboiled meat then the appendix helped in digestion