Coffee and other drinks that contain caffeine can have a laxative effect on some people and cause them to poop and give them diarrhea.
Not everyone gets diarrhea or gets that laxative effect from drinking coffee but it can happen to some people.
For myself coffee makes me pee soon after drinking it since coffee is also a diuretic and can make you urinate a lot.