In baking, gluten is what makes dough “doughy.” It gives the dough elasticity, as well as viscosity. Those properties help to hold a cookie together while it bakes on a sheet in the oven, and they enable cakes and breads to hold onto the gas bubbles that form inside them – this allows them to rise and take shape.
Xanthan gum helps replicate these properties in recipes that do not contain gluten.