A 28-year-old woman presents with chronic pelvic pain and a two-year history of infertility. She reports that her menstrual cycles are regular but accompanied by severe dysmenorrhea, which she describes as debilitating and interfering with her daily activities. She also experiences pain during intercourse (dyspareunia) and occasional bowel discomfort during menstruation. Over-the-counter pain relievers provide little relief. As you prepare to do a physical examination, she says that she is curious to understand the primary mechanism of pain in endometriosis. What is the primary mechanism of pain in endometriosis?