Servants. Yes, robots eventually, but servants are the classical answer. The terrible truth is that palace economies are stable -- we see them in "resource-cursed" countries around the world and through time. When a single easily-owned fountain of wealth dominates the economy, a small group of people consolidate ownership and everyone else polarizes around them, forming into concentric rings of gatekeepers and masses struggling to access the only thing that matters. It's terrible but it's stable, and if you're inside the palace it doesn't feel like much of a curse at all.