It's tempting to attribute the effect to caffeine, since that's the ingredient you're going after when you slurp down a cup of coffee. But think about it: Soda doesn't have the same effect. And studies have found that decaf coffee (which some people drink for some reason, I guess) can have a laxative effect, too.
Scientists have observed -- by way of some very invasive studies -- that coffee of any sort can stimulate the distal colon, which helps push waste out of the body more quickly. So the physical mechanism is well understood, but not what triggers it.
It's possible that the acidity of coffee is the key: Coffee has a compound called chlorogenic acid that triggers higher stomach acid levels and also higher production of gastric acid. It could be that the overall acidity bump makes the stomach dump its contents out more quickly than usual. Something in coffee may also trigger the release of hormones that aid digestion, which would speed up bowel movements. But it's not clear which of the hundreds of chemicals found in a cup of coffee are responsible for that boost.
Don't feel the urge after drinking coffee? Well, remember, the laxative effect occurs in only 30, maybe 40, percent of the population. And according to some research, the effect diminishes over time with habitual coffee consumption. So more coffee doesn't necessarily mean more trips to the bathroom.