Not wanting to leave anything to chance during a period with a high infant mortality rate, the world’s largest harem was placed at the emperor’s disposal to ensure enough heirs would survive into adulthood. Court chronicles record Chinese kings keeping emasculated servants in the eighth century BC, but historians generally date the appearance of eunuchs in court to the reign of Han Huan Di (AD146-167). The government role occupied by eunuchs meant that over time they were able to exert enough influence on emperors to gain control of state affairs and even cause the fall of some dynasties.
The power of the eunuchs endured partly due to the ambitions of the consort families and partly as a result of the secluded lifestyle which etiquette prescribed for the emperor.