Yes, they cut it off. It is a very dangerous procedure, but people go through it to have the chance to climb out of poverty through going up the ranks in the imperial court. There were alot of cases of dynastys having a puppet emperor with a group of eunuchs controlling the actual power.
If you want more bloody details, if the dick is chopped off, they will insert a quill or smthing thin into the urethra hole, to keep it from healing shut. And usually people who want to be eunuchs are poor, thus not having access to painkillers and the like. So they chew some herbs and just bear through it. That's why the mortality rate is so high, infections and being sent into shock from the pain.
The dick and/or balls will be kept preserved in a jar, to be buried with the dead eunuch once he passes. They believe this way will ensure that in the next life, he will be born a 'whole' person.

Plz someone explain this to me, why the uke doesn't have balls?
And thank you for the translation <3