It happens when fragments of tissue and blood from the period stray into the area inside the pelvis and cause problems. Because it's a common cause of infertility, it's important to get endometriosis treated early. See a doctor as soon as possible about any severe or continuing pain in the pelvic area at any time in the menstrual cycle. There can be many reasons for this. But occasionally it can be a symptom of cervical cancer, so always see a doctor about any bleeding between periods, especially if it occurs after sex, or if a woman is over 40.
Pregnancy is an obvious reason, but there can be other causes.
Sometimes adolescent girls have irregular periods if they've recently begun menstruating. A woman's hormones can sometimes be affected by stress or travel which can temporarily affect her cycle. Stopping the contraceptive pill can sometimes cause one or two missed periods. Losing a lot of weight or gaining a lot of weight can be another cause. Missing periods for a few months at a time may mean a woman isn't ovulating and may mean fertility problems - check with a doctor.