Digestion is governed by the parasympathetic nervous system. That means the calmer we are, the better digestion will be. The opposite stands for stress.
Nutrition and hydration play a very important part.
For constipation, in terms of asana practice, the digestive system needs to be stimulated, i.e. inversions, twists and passive backbends.