A baby's immune system isn't fully developed before birth, so it needs a hand. That hand comes from mom, as she passes her own immune-system warriors, called antibodies, through the placenta, and the baby accepts them (this is called passive immunity because the fetus doesn't make antibodies itself, but accepts the mom's). Interestingly, it even turns out that some cells from mom slip through the placenta to teach the baby's cells how to tolerate foreign antigens —diplomatic cells, if you will.
This transmission of antibodies serves two roles—protecting the fetus and signaling to the mother that this foreign tissue has cleared inspection and is safely allowed to park its behind in her uterus for the greater part of the next year. Now, a fetus's immune system does start developing on its own (at 9 weeks), and there's a reason for that delay on the fetus's part. That's to help the fetus to tolerate mom—after all, the fetus is 50 percent dad. If its immune system were fully developed from the get-go, there'd be the chance that the fetus might identify mom as different and reject its host.
The fetus's immune system doesn't start developing until 9 weeks and isn't ready to go until about 14 weeks, so until then, the fetus relies on the placenta and the interface with mom to help protect it from potential harm until it's better able to fight on its own. Recent research shows that the fetus's cells and the mother's immune system join forces to fight common enemies (like infections). When the fetus's cells call for help, the mother's system responds to the TLR alarm and sends reinforcements throughout pregnancy. So, in many ways the placenta is the unsung hero of pregnancy, dutifully providing your baby with nutrients and immunity.