The rooms surrounding the courtyards housed the retinue supporting the Son of Heaven and the rest of the Court. At one time, there were acclaimed to be 1,500 Eunuchs and thousands of Concubines in attendance, though not all housed within the walls.
During one period of turmoil, a favorite Concubine was stuffed down a well for complaining that the Emporer should take responsibility for his actions.
The courtyards and rooms that we traipsed through were all very serene and beautiful, and the shading provided for cooler quarters than many other places. If you avoided drowning or some other form of rather sever punishment for infractions real or imaginary, this was probably the best life other than being a rich landowner in the early times of the Empire.