it's just a shot.
You'll get one if you start to bleed at all, or at 28wks or so, and then after birthing your baby.
essentially, it stops the baby's blood from mixing with yours. Because if that happens and the baby's blood type is different, your body will think it's a foreign object, and fight off the baby as if it is an infection and you'll miscarry.
The shot stops it, and makes your body think that any blood it detects, is the same type as you.