Bowel contents that pass through the anus include the gaseous flatus and the semi-solid feces, which (depending on the type of animal) include: indigestible matter such as bones, hair pellets, endozoochorous seeds and digestive rocks;[3] residual food material after the digestible nutrients have been extracted, for example cellulose or lignin; ingested matter which would be toxic if it remained in the digestive tract; excreted metabolites like bilirubin-containing bile; and dead mucosal epithelia or excess gut bacteria and other endosymbionts.
Amphibians, reptiles and birds use a similar orifice (known as the cloaca) for excreting liquid and solid wastes, for copulation and egg-laying.
[4] In animals at least as complex as an earthworm, the embryo forms a dent on one side, the blastopore, which deepens to become the archenteron, the first phase in the growth of the gut.
In deuterostomes, the original dent becomes the anus while the gut eventually tunnels through to make another opening, which forms the mouth.
Research from 2001 shows the edges of the dent close up in the middles of protosomes, leaving openings at the ends which become the mouths and anuses.