I have a stomachache before defecation because my stool is strange. There are many harmful substances in it, which will stimulate your large intestine and make it contract and spasm continuously, so you will feel unbearable abdominal pain.
That's it. You excreted the poop that stimulated the large intestine. Of course, it doesn't hurt anymore.
You are so cute that you can think of such a question.