Castrati were boys who were castrated so as to retain a high singing voice in adulthood. Thankfully, this practice has ended, although it went on longer than you might think. The last castrato died in 1922.
Eunuchs were familiar figures in the Assyrian Empire (ca. 850 until 622 BC) and in the court of the Egyptian Pharaohs (down to the Lagid dynasty known as Ptolemies, ending with Cleopatra, 30 BC). Eunuchs sometimes were used as regents for underage heirs to the throne, as it seems to be the case for the Neo-Hittite state of Carchemish. Political eunuchism became a fully established institution among the Achamenide Persians. Eunuchs held powerful positions in the Achaemenide court. The eunuch Bagoas (not to be confused with Alexander's Bagoas) was the Vizier of Artaxerxes III and IV, and was the primary power behind the throne during their reigns, until he was killed by Darius III.