I have said this before, but I see some parallels between the modern world and Japan during the early Tokugawa era. Japan had pretty much reached a steady state by the time Tokugawa Iyeyasu came to power in 1600; most of the available land had been cultivated or settled, and, especially after the policies of Toyotomi Hideyoshi, society was locked in a rigid structure without much room for advancement or unrest. As a…
Japanese developed clever formal court system (Sankin-kotai "alternate attendance") where half of the daimyos were kept hostage in the capital city at all times. Spend year in your own lands surrounded by your own men, one year as hostage in the capital that was under the control of the shogun. If daimio left the capital, his wife and heir were kept as hostages. All these daimios and their close families needed something to do to make their life meaningful. Same applied to their underlings.
King Louis XIV had similar system for the same reasons. Nobles had to keep hostage in his palace at Versailles and they needed things to do. The court system developed bullshit jobs for nobles, like helping him into the bed or taking part of the party. Everyone was given a role to play.