"The menstrual cycle is the series of changes a woman's body goes through to prepare for a pregnancy. About once a month, the uterus grows a new lining (endometrium) to get ready for a fertilized egg camera. When there is no fertilized egg to start a pregnancy, the uterus sheds its lining. This is the monthly menstrual bleeding camera (also called menstrual period) that women have from their early teen years until menopause, around age 50."
It goes back to adam and eve when eve sinned in the garden of eden by eating the fruit from the tree of knowledge god punished her by the pain of child birth so in retrospect girls have their periods look it up in the bible in genesis