Castration before puberty (or in its early stages) prevents the boy's larynx from being fully transformed by the normal physiological effects of puberty. As a result, the vocal range of prepubescence (shared by boys and girls) is largely retained, and the voice develops into adulthood in a unique way. As the castrato's body grows (especially in lung capacity and muscular strength), and as his musical training and maturity increase, his voice develops a range, power and flexibility quite different from the singing voice of the adult female, but also markedly different from the higher vocal ranges of the uncastrated adult male. (From Wikipedia.)This BBC article includes a 1902 sound clip of the only castrati ever to be recorded: Alessandro Moreschi, who directed the Sistine Chapel Choir until 1913. (Moreschi also recorded an Ave Maria.) His voice is odd and freaky and gives me the shivers, frankly -- I can't really be comfortable listening to it, knowing how the bizarre vocal quality was obtained.
H/T Whispers in the Loggia