Progesterone prescribed in early pregnancy

mtl

I just went to the ER because of bleeding and some clots, but we listened to the heart beat and had an ultrasound and baby is okay. The doctor checked and my cervix is closed, so not sure why the bleeding is happening. They called my OBGYN and he is going to have me start taking progesterone. Can anyone give me some insight on what exactly it does? Has anyone had a similar experience and had a healthy pregnancy? I've had two pregnancies, both resulting in miscarriages in the past.