Why do they give misoprostol pills after surgical

Ta

I had the surgical procedure and was given after misoprostol pills to take home