Stimulant laxatives are used to encourage bowel movements by irritating the inner lining of the intestinal wall. Stimulant laxatives (such as Ex-Lax and Senokot) increase muscle contractions in the large intestine which push stool toward the rectum. These smooth muscle contractions called peristalsis cause the intestine to narrow and then propel the narrow portion forward. Peristalsis looks like an ocean wave travelling slowly through the large intestine.
Unlike water retention laxatives (such as Miralax or Milk of Magnesia) which are used to keep stool consistently moist (soft) and easier to pass, stimulant laxatives are used to increase the feeling of urgency (the need to poop) and to increase the amount of stool produced the following day. It is not uncommon to treat functional constipation/encopresis with a combination of both of these laxatives.