Menstrual cramps, or period cramps, are caused primarily by a chemical called prostaglandin. Prostaglandins are produced by the uterine lining and cause the muscles of the uterus to contract (tighten and relax). These contractions help shed the uterine lining during menstruation. High levels of prostaglandins make the contractions stronger and more painful, which results in the cramping sensation commonly felt during periods. The cramps typically begin a day or two before menstruation starts and ease after a few days once prostaglandin levels decrease. Some individuals may experience more severe cramps due to higher prostaglandin levels or other underlying conditions affecting reproductive organs.
In summary, the cramps are caused by the uterus contracting due to the chemical prostaglandin, which facilitates the shedding of the uterine lining, and elevated levels of prostaglandin intensify the pain.