The rectum has little shelves in it called transverse folds. These folds help keep stool in place until you're ready to go to the bathroom. When you're ready, stool enters the lower rectum, moves into the anal canal, and then passes through the anus on its way out.

