It happens when endometrial tissue moves into the uterus's muscle. This can be caused by hormonal issues or inflammation.