It comes from the storage materials of the plant world used to store water. There are many different types, but they are all hydrocolloids and bind from 20-200 times their weight in water. Some of soluble fiber's health benefits are attributed to this viscosifying effect. Others are attributed to its ability to bind things to itself. Within the soluble dietary fiber class, there are two main divisions, fermentable and non-fermentable.
Fermentable fiber goes on to feed the bacteria that inhabit our colons.
If your intestinal bacteria are healthy, you are likely to be healthy. For example, the reason people often get diarrhea from antibiotic treatments is that the drugs can wipe out the colony of microflora.