In the harem, only two figures were higher than the empress: the emperor and the queen mother. Meanwhile, others are obliged to obey their orders. Breaking can mean death.
Apart from the empress there was also the empress dowager - the emperor's widow who was given the rank. Under the empress there are consorts or official concubines. Their number and rank differ depending on the ruling ruler. Not only that, the eunuchs who served the king's women were also an inseparable part of the harem.
And, to ensure that every child born in the harem was a descendant of the emperor, men were strictly forbidden from entering the ruler's wives' compound. The only exception was eunuchs who had been castrated.