Figure 5.1 “Genital Development Before Birth” shows how genitals develop prenatally (in the womb). The top two images show how all people start off about seven weeks after conception with the same basic set of reproductive structures. After that point, genitals start to differentiate into male-type, female-type, or in-between types.
The left side of the diagram shows how most males develop. The right side shows how most females develop. Some children with DSDs end up with genitals that look something between the typical-male and typical-female. (Keep in mind not all children with DSDs have atypical-looking genitalia. For some, the DSD is limited to their internal structures, physiology, or genes.) If a child has in-between genitals, or has genitals typical to one sex and internal organs typical to the other, that is because something happened prenatally to make her or his development happen along a less common sex development pathway.
There is an excellent online animation showing how genital development happens before birth in children with and without DSDs at http://www.sickkids.ca/childphysiology/cpwp/Genital/genitaldevelopment.htm
In that animation, if you click on the word “genitals” on the left, then “genital formation” on the left, you’ll find an animation that shows how boy genitals and girl genitals start out looking the same (from conception to week 7), then develop along different lines under the influence of hormones. If the fetus has an unusual level of certain hormones, or an unusually high or low ability to respond to them, then an in-between genital appearance can result.