I guess it is related to adrenaline or maybe cortisol - adrenal glands. Or brain - you are in panic will the others smell you and you are going into the fight-or-flight response so brain is ordering your adrenal glands to relase adrenaline.
I don't remember what exactly adrenaline does to gut, but I know it's not good. Maybe it is combination of adrenaline and cortisole, I'm not sure, but the answer is there
Anyway, you have to calm down and not go into the panic mode. I know it's hard, but...