Coffee can give you more than just a caffeine buzz. For a large number of people—about one-third of the population—it also prompts a run for the bathroom. While this effect is widely documented, scientists aren’t exactly sure what’s behind it.

“It’s widely understood that coffee has a laxative effect on some people,” the American Chemical Society’s Reactions series noted in a 2015 video, but it’s complicated to tease out which part of coffee causes it.

It’s not just the caffeine, because decaf coffee can inspire the same, um, urgency. And people don’t run to the bathroom immediately after swilling a Coke. So what's happening inside your gut that makes you bolt for the commode just after finishing your morning cup o' joe?

Coffee has been found to stimulate your large intestine within just four minutes of ingestion, and drinking it increases the levels of certain digestive hormones in the gut. Coffee's laxative properties might also have something to do with its acidity, which helps your stomach produce more gastric acid to break down proteins. A compound in coffee called chlorogenic acid boosts stomach acid levels. This applies whether your coffee is caffeinated or not. As a 1986 study found, both decaf and regular coffee cause significant stimulation of gastric acid. (Both may also promote acid reflux, unfortunately, though the research is a bit contradictory.)

But that doesn’t mean all coffees are alike when it comes to spurring an increase in stomach acid. Research presented to the American Chemical Society in 2010 found that N-methylpyridinium, a chemical compound created in the roasting process, blocks the stomach’s ability to produce acid, meaning that dark-roasted coffees might actually be a bit easier on irritable stomachs than light-roasted varieties.

Some studies have found that coffee can accelerate gastric emptying—meaning the rate it takes for your stomach contents to empty into the small intestine—but this, too, is controversial, and some studies say coffee doesn’t impact gastric emptying at all. Since coffee only makes a portion of the population poop, though, it might just be that smaller studies (one only looked at 12 individuals) happen to not include any people whose bowels are really affected by coffee.

But the fact of the matter is, of the many chemical compounds contained in coffee, scientists aren't entirely sure which one is the poop perpetrator.

Poop is not just a byproduct of coffee drinking, either. Sometimes, it’s a vital part of the production process. Civet coffee, or kopi luwak, is known as one of the most expensive coffees in the world. It’s made from partially digested beans harvested from the feces of a civet. Because the beans have already passed through one stomach (the animal’s), the resulting coffee is much less acidic, meaning it’s a much smoother tasting—and feeling—experience for the humans who later drink the civet’s castoffs.

If you’re one of the many people whose coffee habits land them in the bathroom, know that all that post-brew pooping might not be a bad thing. Studies find that most people in the U.S. don’t eat enough fiber in their diet, so it may be a blessing that the average American drinks three cups of coffee a day. Otherwise, they’d have to change it to “land of the free and home of the blocked.”

Have you got a Big Question you'd like us to answer? If so, let us know by emailing us at bigquestions@mentalfloss.com.