The small intestine takes partially digested food from the stomach and begins the process of making it compact using mucus, stomach acid, and digestive fluid from the gall bladder.
The food then passes into the large intestine where moisture and any left over vitamins or nutrients are absorbed, turning the food into fecal matter passing this through the rectum and then anus.