Women are born with a fixed number of eggs, and this number declines progressively throughout her life until the menopause.
This decline occurs even if she is on the contraceptive pill, or if she is pregnant or not having any periods at all. It is currently not known exactly what determines this decline, although it is accelerated by ovarian surgery and smoking, and some will have a specific genetic predisposition (eg. Fragile X syndrome).
The average age for menopause is 51, but 1% of women have menopause (no periods due to a lack of eggs) before age 40. From a reproductive perspective, fertility declines about 10 years before the actual menopause. This can now be assessed with a simple blood test called AMH (anti Mullerian hormone). A low level can be helpful in family planning, decision to consider freezing eggs, and can guide fertility treatment (such as drug doses in IVF).