A eunuch is a man whose testicles have been completely or partially removed. This could have been the result of either a surgical operation or accident, but the outcome is one and the same - a man who, for objective reasons, cannot secrete the most important sex hormones, or have normal sex organ function.
In the past, eunuchs were created forcibly, to serve as harem guards to Turkish sultans and Chinese emperors. This was the only way for the rulers to be absolutely certain that their wives and concubines would be faithful, and that the children born by them would in fact be theirs.
Traditionally, the eunuchs who served in the harems of Turkish sultans were Sudanese blacks, who were castrated while they were still young boys. They were bought and sold in different regions throughout the Near East, where they also served as guards and assistants.
The horrifying practice of castrating boys came to Europe as well but for very different reasons. During the Middle Ages, all young boys who could sing proficiently were castrated, so that they wouldn't lose their beautiful, melodious voice.
Usually, this barbaric act was done before puberty, before changes in the boy's body could occur. One of the most famous castrati was the famed Farinelli (Il Castrato), well-known to fans of classical opera.
Castration and the creation of eunuchs is still done today, primarily for religious reasons. There are still places in some countries, mainly India and Russia, where so-called "castrati cults" thrive. Eunuchs that are members of these believe that by removing their sexual organs they honor or get closer to a particular deity.