The introduction of food stimulates the digestive tract, "waking it up" in some instances. Down the line... this may stimulate or increase peristalsis, causing digested foods in the intestines to be pushed along.
Then, if any makes it to the rectum (or it is already there), the necessary mechanisms are prompted for elimination.