Endometriosis, an estrogen-dependent chronic inflammatory disease characterized by the growth of endometrium-like tissues outside the uterine cavity, affects 10% of reproductive-age women. Although the pathogenesis of endometriosis is uncertain, it is widely accepted that retrograde menstruation results in ectopic endometrial tissue implantation. Given that not all women with retrograde menstruation develop endometriosis, immune factors have been hypothesized to affect the pathogenesis of endometriosis. In this review, we demonstrate that the peritoneal immune microenvironment, including innate immunity and adaptive immunity, plays a central role in the pathogenesis of endometriosis. Current evidence supports the fact that immune cells, such as macrophages, natural killer (NK) cells, dendritic cells (DCs), neutrophils, T cells, and B cells, as well as cytokines and inflammatory mediators, contribute to the vascularization and fibrogenesis of endometriotic lesions, accelerating the implantation and development of ectopic endometrial lesions. Endocrine system dysfunction influences the immune microenvironment through overexpressed estrogen and progesterone resistance. In light of the limitations of hormonal therapy, we describe the prospects for potential diagnostic biomarkers and nonhormonal therapy based on the regulation of the immune microenvironment. Further studies are warranted to explore the available diagnostic biomarkers and immunological therapeutic strategies for endometriosis.