It gears up for birth by tightening - seemingly randomly - which you feel as Braxton-Hicks contractions. And then during the big event, these contractions become incredibly strong and intensely powerful as together you push your baby into the world.
After birth, it begins to contract again (these are after-pains and they can be very intense especially in second and later births) and begins the journey to its pre-pregnancy size. In a week, it's about half the size it was at the peak, by two weeks it can barely be felt and by six weeks, it should be back to its regular, pre-pregnancy self.
So, take a minute to appreciate and admire everything your uterus does during pregnancy. It is powerful and strong and safe... and so are you.