We provide the first analysis and synthesis of the evolutionary and mechanistic bases for risk of endometriosis in humans, structured around Niko Tinbergen's four questions about phenotypes: phylogenetic history, development, mechanism, and adaptive significance. Endometriosis, which is characterized by the proliferation of endometrial tissue outside of the uterus, has its phylogenetic roots in the evolution of three causally-linked traits: (1) highly-invasive placentation, (2) spontaneous rather than implantation-driven endometrial decidualization, and (3) frequent extensive estrogen-driven endometrial proliferation and inflammation, followed by heavy menstrual bleeding. Endometriosis is potentiated by these traits, and appears to be driven, proximately, by relatively low levels of prenatal and postnatal testosterone. Testosterone affects the developing HPO (hypothalamic-pituitary-ovarian) axis and at low levels it can result in an altered trajectory of reproductive and physiological phenotypes that in extreme cases can mediate the symptoms of endometriosis. Polycystic ovary syndrome, by contrast, is known from previous work to be caused primarily by high prenatal and postnatal testosterone, and it demonstrates a set of phenotypes opposite to those found in endometriosis. The hypothesis that endometriosis risk is driven by low prenatal testosterone, and involves extreme expression of some reproductive phenotypes, is supported by a suite of evidence from genetics, development, endocrinology, morphology and life history. The hypothesis also provides insights into why these two diametric, fitness-reducing disorders are maintained at such high frequencies in human populations. Finally, the hypotheses described and evaluated here lead to numerous testable predictions, and have direct implications for the treatment and study of endometriosis.