Why is my body doing this to me

About every three months or so my body just feels the need to not let me eat without feeling sick and get diarrhea. Like I have to constantly be in the bathroom bc it just hits at any moment. I'll even have the urge to go but can't. I can't even eat because it literally goes straight through me. I already have trouble holding weight and every time this happens, it usually lasts for a week, I lose 8-14 pounds easily. Does anyone know why this happens or does it happen to anyone else?