The primary cause of menstrual cramps is the contraction of the uterus to help expel its lining. These contractions are triggered by hormone-like substances called prostaglandins. Higher levels of prostaglandins are associated with more severe menstrual cramps. Other causes can include conditions like endometriosis, fibroids, and pelvic inflammatory disease (PID).