The following is quoted from the book "Why Is Sex Fun? The Evolution of Human Sexuality" by Jarad Diamond (professor of physiology at UCLA Medical School)
------------------------------------------------------------
Since a Y chromosome specifies testes, and since the presence or absence of the testes' secretions specifies the remaining male or female structures, it might seem as if there's no way that a developing human could end up with ambiguous sexual anatomy. Instead, you might think that a Y chromosome should guarantee 100 percent male organs, and that the lack of a Y chromosome should guarantee 100 percent female organs.
In fact, a long series of biochemical steps is required to produce all those other structures besides ovaries or testes. Each step involves the synthesis of one molecular ingredient, termed an enzyme, specified by one gene. Any enzyme can be defective or absent if its underlying gene is altered by a mutation. Thus, an enzyme defect may result in a male pseudohermaphrodite, defined as someone possessing some female structures as well as testes. In a male pseudohermaphrodite with an enzyme defect, there is normal development of the male structures dependent on enzymes that act at the steps of the metabolic pathway before the defective enzyme. However, male structures dependent on the defective enzyme itself or on subsequent biochemical steps fail to develop and are replaced either by their female equivalent or by nothing at all. For example, one type of pseudohermaphrodite looks like a normal woman. Indeed, "she" conforms to the male ideal ideal of female pulchritude even more closely than does the average real woman, because "her" breasts are well developed and "her" legs are long and graceful. Hence cases have turned up repeatedly of beautiful women fashion models not realizing that they are actually men with a single mutant gene until genetically tested as adults.
Since this type of pseudohermaphrodite looks like a normal girl baby at birth and undergoes externally normal development and puberty, the problem isn't even likely to be recognized until the adolescent "girl" consults a doctor over failure to begin menstruating. At that point, the doctor discovers a simple reason for that failure: the patient has no uterus, fallopian tubes, or upper vagina. Instead, the vagina ends blindly after two inches. Further examination reveals testes that secrete normal testosterone, are programmed by a normal Y chromosome, and are abnormal only for being buried in the groin or labia. In other words, the beautiful model is an otherwise normal male who happens to have a genetically determined biochemical block in his ability to respond to testosterone.
The block turns out to be in the cell receptor that would normally bind testosterone and dihydrotestosterone, thereby enabling those androgens to trigger the further developmental steps of the normal male. Since the Y chromosome is normal, the testes themselves form normally and produce normal Mullerian inhibiting hormone, which acts as in any man to forestall development of the uterus and fallopian tubes. However, development of the usual male machinery to respond to testosterone is interrupted. Hence development of the remaining bipotential embryonic sex organs follows the female channel by default: female rather than male external gentialia, and atrophy of the Wolffian ducts and hence of potential male internal genitalia. In fact, since the testes and adrenal glands secrete small amounts of estrogen that would normally be overridden by androgen receptors, the complete lack of these receptors in functional form (they are present in small numbers in normal women) makes the male pseudohermaphrodite appear externally superfeminine.