It is often not the amount of fibre which we eat to maintain digestive health that is important, but the type of fibre.
There are 2 forms, soluble which dissolves in water, and insoluble which does not.
Oats, barley, peas, flaxseed and some fruit and vegetables are forms of soluble fibre, it turns to a gel like substance during digestion and can help with both constipation, by making the stool softer, and with loose bowels, by acting as a bulking agent.
Insoluble fibre found in wheat and particularly bran, holds onto water and so has a greater laxative effect and therefore may be a problem for people who suffer from loose bowels. It can however help push stools through the system if constipation is an issue but can be pretty rough on the digestive system.
A balance between the 2 types of fibre is therefore recommended as a means of maintaining gut health.