At the time of your period, your body releases chemicals known as prostaglandins. As these are released during the first few days of menstruation, they can trigger painful uterine contractions and cramping to speed the process of shedding the uterine lining.