This is what wikipedia has to say on the "matter":
Caffeine is a bitter, white crystalline xanthine alkaloid that acts as a psychoactive stimulant drug.
Like alcohol and nicotine, caffeine readily crosses the blood–brain barrier that separates the bloodstream from the interior of the brain. Once in the brain, the principal mode of action is as an antagonist of adenosine receptors.[49] The caffeine molecule is structurally similar to adenosine, and binds to adenosine receptors on the surface of cells without activating them (an "antagonist" mechanism of action). Therefore, caffeine acts as a competitive inhibitor.
Caffeine relaxes the internal anal sphincter muscles and thus should be avoided by those with fecal incontinence.[62]