The rectum is about eight inches long and serves, basically, as a warehouse for poop. It hooks up with the sigmoid colon to the north and with the anal canal to the south.
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.