Could it be that eunuchs in the palace, holding numerous secrets, received special affection from the emperor?
In feudal China, eunuchs were responsible for serving the emperor, concubines, and palace maids. During that era, individuals from humble backgrounds, lacking family influence, boldly embraced the role of eunuchs.
They had to undergo the painful process of castration, sacrificing their reproductive organs to enter the palace. Society at that time often looked down upon and mistreated those who became eunuchs.
Contrary to common perception, the emperor showered immense favor and trust upon eunuchs. In recorded history, many eunuchs were even entrusted with high-ranking positions in the imperial court. Why did this phenomenon occur?
The emperor's reliance on eunuchs can be attributed to three fundamental reasons.

Firstly, eunuchs are those close to the emperor. Many emperors, from a young age, are nurtured by wet nurses and eunuchs. Those who are in constant proximity to the sovereign are the eunuchs. Therefore, eunuchs are the ones who understand the emperor's sentiments the most. From this, they receive the utmost trust from the monarch.
Secondly, eunuchs serve as a safety measure. Ancient kings often inherit the throne from their fathers. Not every monarch possesses the ability to govern a nation, and despite personal reluctance, they must fulfill their duties.
However, if the emperor places excessive trust in a particular civil or military official within the court, these individuals may likely vie for power, seizing the throne from the ruler. Therefore, emperors opt for eunuchs without significant influence to serve as their close confidants.
Thirdly, eunuchs are reliant on the emperor. The majority of eunuchs lead solitary lives until their passing. Moreover, their families lack wealth and influence. Their entrance into the palace to serve the imperial family is primarily for survival. Consequently, eunuchs often lack ambition, are submissive, and are more dependent than others. Hence, they receive special favor from the emperor.
Source: Sohu