Coffee contains caffeine, caffeine is a stimulant, and a stimulant is known to, well, stimulate bowel movements…basically it makes you need a number 2. Research supports this theory, and an analysis of all existing research suggests that it may not be simply down to caffeine, but also warmth. A warm substance is also a vasodilator (widens blood vessels) which increases blood flow and digestive activity in the bowel.
When ascertaining whether it was caffeine that caused the ‘need to defecate’, at least one study suggests that a decaffe cup of coffee also increased the urge to defecate, indicating that it may not be caffeine, but any warm liquid itself that is responsible for stimulating a number 2.
Macmillan, (2015). Prevention. Health : Digestive Health. Retrieved 27th March, 2015, from http://www.prevention.com/health/make-yourself-poop?cid=socHE_20150307_41688746&adbid=574042126041751552&adbpl=tw&adbpr=25092348