Menstruation in women is under the influence of the hypothalamic-pituitary-ovarian axis, or HPO axis. The pituitary gland secretes follicle-stimulating hormone (FSH) and luteinising hormone (LH), which act to stimulate production of oestrogen and progesterone in the ovaries. There is a feedback loop in which these latter two hormones modify the production of FSH and LH by acting on the hypothalamus.
In the first 4 days of the cycle, high FSH levels stimulate follicle development in the ovary, which in turn releases oestrogen causing development of the endometrium (womb lining). At 14 days, the oestrogen level rises sufficiently to kickstart a positive feedback mechanism which causes an LH surge, and ovulation (where the follicle releases an ovum, or egg) starts. After this, the primary follicle now forms a structure called the corpus luteum or "yellow body" - this produces progesterone, preparing the endometrium for implantation. Subsequent events depend on whether or not fertilisation occurs: if it does, beta-HCG allows the corpus luteum to persist and the embryo embeds in a well built-up womb; if it does not, the corpus luteum breaks down - this is when menstruation occurs as a dip in progesterone causes the endometrial lining to slough (associated other a loss of blood).