A castrato is a male soprano, mezzo-soprano, or alto voice produced either by castration of the singer before puberty or one who, because of an endocrinological condition, never reaches sexual maturity.
Castration before puberty (or in its early stages) prevents a boy's larynx from being transformed by the normal physiological events of puberty. As a result, the vocal range of prepubescence (shared by both sexes) is largely retained, and the voice develops into adulthood in a unique way. As the castrato's body grew, his lack of testosterone meant that his epiphyses (bone-joints) did not harden in the normal manner. Thus the limbs of the castrati often grew unusually long, as did the bones of their ribs. This, combined with intensive training, gave them unrivalled lung-power and breath capacity. Operating through small, child-sized vocal cords, their voices were also extraordinarily flexible, and quite different from the equivalent adult female voice, as well as higher vocal ranges of the uncastrated adult male (see soprano, mezzo-soprano, alto, sopranist, countertenor and contralto). Listening to the only surviving recordings of a castrato (see below), one can hear that the lower part of the voice sounds like a "super-high" tenor, with a more falsetto-like upper register above that.
During the 17th and 18th centuries in Italy, some 4,000 - 5,000 boys were castrated annually for the purpose of singing alto in the church choirs. According to Melicow and Pulrang (Urology 3: 663-670, 1974), the prohibition against women singing in the church choir had its origin in the bible: "Let your women keep silence in the churches; for it is not permitted unto them to speak" (I Corinthians 14:34). Thus, castrated men (castrati) came to sing in the choir, possessing "the chest and lungs of a man with the vocal cords of a women (Melicow and Pulrang)."
Castrati were considered to be the greatest singers of all time, dominating opera in Italy for two centuries. Castrati were rarely referred to as such: in the eighteenth century, the term musico (pl musici) was much more generally used, though it usually carried derogatory implications; another synonym was evirato (literally meaning "unmanned").
By the late eighteenth century, changes in operatic taste and social attitudes spelled the end for castrati. They lingered on past the end of the ancien régime (which their style of opera parallels), and two of their number, Pacchierotti and Crescentini, even entranced the iconoclastic Napoleon. The last great operatic castrato was Giovanni Battista Velluti (1781-1861), who performed the last operatic castrato role ever written: Armando in Il Crociato in Egitto by Meyerbeer (Venice, 1824). Soon after this they were replaced definitively as the first men of the operatic stage by the new breed of heroic tenor as incarnated by the Frenchman Gilbert-Louis Duprez, the earliest "king of the high Cs", whose successors are singers like Caruso, Franco Corelli, and Luciano Pavarotti. The last of the great Castrati singers was Allessandro Moreschi (1858-1922), whose voice was immortalized on a 1902 gramophone recording, which was later digitized and is currently in print.
There have long been rumours of another castrato sequestered in the Vatican for the personal delectation of the Pontiff until as recently as 1959, but these have been definitively shown to be false. The singer in question was a pupil of Moreschi's, Domenico Mancini, such a skillful imitator of his teacher's voice that even Lorenzo Perosi, Direttore Perpetuo of the Sistine Choir from 1898 to 1956 and a lifelong opponent of castrati, thought he was a castrato. Mancini was in fact a moderately skilful falsettist and professional double-bass player.
For those interested in more information, here's a list of resources on castrati: