It affects it because, as you move rapidly (if a fast exercise), your food moves all over the place and the digestive system's acids can't work properly. If a slow exercise (Like yoga), it may help the digestive system because you're calm and your mood affects your metabolism (the rate energy is used).