Unlike popular belief that food is excreted immediately after eating, transit time for bowel is totally different. Food can take anywhere from 1 day to 3 days to get completely excreted. Till that time at least some particles of the food remains in the intestine. If you have bowel movement just after taking food, it is the food that was already present in the colon and not the one that you have taken. Some people have the habit of passing stool shortly after eating meals. Food particles travel from the mouth goes through esophagus and reaches the stomach. Here several enzymes and acids would act upon it converting it into semisolid chyme.
This would gradually pass into the small intestine where bile would play an important role in absorbing essential food nutrients. The leftover food particles would be sent to large intestine which gets mixed with fluid before getting ready for excretion. Average time the food remains in your abdomen is 12-48 hours. Bowel irritation can be the major cause for diarrhea immediately after eating. Sometimes, reflexive action of the nerves for passing stools get triggered prematurely creating sudden urge to use the toilet. There are people who get tempted to pass stool even while eating. The lower portion of the colon is filled with large volumes of feces which creates pressure. This force would trigger the nerve reflexes urging the person to pass the stool immediately.
Diarrhea :
Diarrhea can be defined as frequent loose movement of stool. Liquid bowel movements are common during diarrhea and the number of times you visit the toilet would be more. When a person has diarrhea the nerves that manage the bowel activity gets irritated. Due to constant pressure and irritation these nerves would affect other regions of the colon causing defecation reflexes or sudden bowel movement.