"one of the Chief Eunuchs in his palace"
A Eunuch is a castrated male. In Imperial China, Eunuchs frequently served as important advisors to the Emperor. As a castrated male could never become Emperor in China, they were among the most trusted advisors.
One of the most famous Eunuchs was Zheng He, who in the 15th century commanded naval expeditions in giant ships right across the Indian Ocean.