Fiber can be used to relieve mild to moderate diarrhea. Soluble fiber soaks up a significant amount of water in the digestive tract, thereby making stool firmer and slower to pass...not cause D.
Insoluble fibres absorb and retain water, accelerating the transit time of gastrointestinal contents. For many IBS patients, insoluble fibre is hard on the system. For others, it can help to prevent constipation.
Water-insoluble fibres are made up of a) Lignin (found in vegetables), b) Cellulose (found in wheat), and c) Hemicellulose (found in cereals and vegetables). Cellulose and hemicellulose are substrates for microbial fermentation, which provides energy, and may also be important in converting toxic or carcinogenic compounds into non-toxic forms.
These fibres also increase stool bulk, which can help with muscle tone in the colon.
Again, I must mention that insoluble fibre is hard on the system. You shouldn't cut it out completely, but don't overdo it either.