Maybe a silly question, but I've been trying to learn a lot of baking fundamentals and trying to understand specifically what makes a cake. Most explanations I've read are something along the lines of:

* flour for structure
* fat to interfere with gluten development
* sugar for taste and moisture
* binder (eggs) to keep it all together

Then the explanation for the flour is that the water and flour interact to produce gluten that then gives the cake its structure. One main thing doesn't make sense to me here though:

**If flour is there for the gluten, and gluten is required to form the structure of cake, how can gluten-free baking ever work?**

Now, I've done gluten-free baking plenty of times. Have never really had an issue. Additionally there are tons of alternatives, how can you get something cake-y out of so many different materials, none of which have gluten? Are there alternative protein networks that function like gluten? Are these protein networks common or rare, or beside the point altogether?

Not sure if it's related, but why does adding xanthan gum to these gluten-free flours seem to always make them better?