The evolutionary story of asses, particularly anuses, remains shrouded in mystery. When did animals go from a one-hole digestive sac to the tunnel we know and love today? Over at The Atlantic, Katherine Wu explores this curious topic in a piece titled "The Body's Most Embarrassing Organ Is an Evolutionary Marvel." From The Atlantic:
In the beginning, there was nothing. The back ends of our animal ancestors that swam the seas hundreds of millions of years ago were blank, relegating the entry and exit of all foodstuffs to a single, multipurpose hole. Evolutionary echoes of these life-forms still exist in corals, sea anemone, jellyfish, and a legion of marine worms whose digestive tract takes the form of a loose sac. These animals are serially monogamous with their meals, taking food in one glob at a time, then expelling the scraps through the same hole. (Contrary to what you might have read, not everyone poops.) These creatures' guts operate much like parking lots, subject to strict vacancy quotas that restrict the flow of traffic.
The emergence of a back door transformed those parking lots into highways—the linear "through-guts" that dominate body plans today. Suddenly, animals had the luxury of downing multiple meals without needing to fuss with disposal in between; digestive tracts lengthened and regionalized, partitioning into chambers that could extract different nutrients and host their own communities of microbes. The compartmentalization made it easier for animals to get more out of their meals, Andreas Hejnol, a developmental biologist at the University of Bergen, in Norway, told me. With the lengthening and uncorking of the end of the gut, he said, many creatures grew into longer and larger body forms, and started to move in new ways. (It would take several more eons for true buttocks—the fleshy, fatty accoutrements that flank the anuses of some animals, such as humans—to evolve. Some researchers I talked with are comfortable using butt to mean any anal or anus-adjacent structure; others are purists, and consider the term strict shorthand for buttocks and buttocks alone.)