The benefits of a high-fibre diet are well known - but now US researchers have found out just how roughage keeps people "regular".
Fibre-filled foods are a key part of a healthy diet
A team from the Medical College of Georgia say the foods damage cells in the gastrointestinal tract, freeing up lubricating mucus within.
The Public Library of Science Biology study could also help understand the detail of the cell repair process.
This could help in other conditions where cell damage plays a part.
Endothelial cells in the GI tract spend most of their lifespan of a few days being bombarded by food as it is passes.
They act as a boundary between the body and "external" substances.
When fibrous foods, which cannot be fully digested, hit a cell, the outer cover ruptures and cell-protecting mucus is released.
The cells then act within seconds to repair the damage, producing more beneficial mucus in the process.
Dr Paul McNeil, one of the researchers who carried out the study, said: "When you eat high-fibre foods, they bang up against the cells lining the gastrointestinal tract, rupturing their outer covering.
"What we are saying is this banging and tearing increases the level of lubricating mucus. It's a good thing."
"An injury at the cell level can promote health of the GI tract as a whole."
While the study is increasing understanding of what happens in the GI tract, the researchers say it might also help understanding of how other cells work.
Dr McNeil has already found that cells with internal membranes use them to repair outer-membrane injuries which could allow dangerous calcium into the cell.
The team used lasers to make holes in cells, recreating the same kind of damage as is seen, and found cells repeatedly repaired themselves.
Dr Katsuya Miyake, who led the study, said: "We have found a very natural way we can enhance mucus production."
The researchers say the finding about the behaviour of damaged cells could also help understanding of other conditions - including some forms of muscular dystrophy.
In muscle cells, it is the efficient repair of the cell which is important rather than the lubricating mucus.
Sue Baic, of the British Dietetic Association, said: "Fibre helps constipation and protects against things like piles and colon cancer so this gives us a mechanism by which the fibre stimulates the cells to produce mucus to help move it along quicker.
"The mucus will also protect the bowel from the sorts of carcinogens we take in which might cause bowel cancer.
"It was thought that it was the fibre absorbing water and bulking out which stimulates movement but this gives another mechanism. Its especially interesting how the mucus could provide a lining against carcinogens."