Half the dry weight of stools is dead bacteria/etc. The more dead bacteria your stools contain the softer they'll be. Most of the bacteria in your gut feed on soluble fibre (The "Good" kind that is). So when you eat more fibre your gut bacteria can multiply and more dead weight comes out the other end.
That's how I understand it anyway.
I eat a lot of fiber, and if I take pain medicine, it doesn't matter how much fiber I eat, I get hard dry painful stool and need to take a stool softener. So this makes me wonder how much fiber actually softens stools and why the stool softener contains no fiber?