Xanthan gum is a long chain polysacharide composed of the sugars glucose, mannose, and glucuronic acid. The backbone is similar to cellulose, with added sidechains of trisacharides (three sugars in a chain).
A polysacharide is a chain of sugars. Some familiar polysacharides are starch and cellulose.
It is a slimy gel produced by the bacterium Xanthomonas campestris, which causes black rot on cruciferous vegetables such as cauliflower and broccoli. The slime protects the bacterium from viruses, and prevents it from drying out.
Xanthan gum is used as a thickener in sauces, as an agent in ice cream that prevents ice crystals from forming, and as a fat substitute that adds the "mouth feel" of fat without the calories. It is used in canned pet food to add "cling".
In pastry fillings, it prevents "weeping" (syneresis) of the water in the filling, protecting the crispness of the crust.
It has a very high viscosity (thickness) even when very little is used.
The backbone of Xanthan gum is similar to cellulose, but the trisacharide side chains of mannose and glucuronic acid make the molecule rigid, and allow it to form a right-handed helix. These features make it interact with itself and with other long chain molecules to form thick mixtures and gels in water.