Coffee contains caffeine and caffeine is known to relax the sphincter muscle while also increasing blood flow. This combination causes the need to poop.
Coffee contains alot of caffeine which causes your intestines to become stimulated and increases the movement of your intestines which creates a bowel movement. It also depends on the type of coffee brand you drink.
Coffee has caffeine and this is a mild diuretic. This can give you gas or produce an even stronger response. Usually the unpleasant feeling will settle quickly, but they can last for a while.
All I can say is that sometimes coffee acts like a laxative on some people. It is a natural laxative that seems to work every time. So forget the Exlax and drink coffee it is easier.