Mammal embryos are protected in several ways within the uterus.
Physical protection: The amniotic sac cushions the fetus from shocks. The placenta acts as a barrier between maternal and fetal blood while allowing nutrient and oxygen exchange and waste removal. The muscular uterine wall shields the fetus from external pressure.
Immune protection: Maternal antibodies cross the placenta to provide passive immunity, and the fetus develops its own immune system over time.
Other factors: Hormones regulate development, and the placenta supplies a steady flow of nutrients and oxygen.
Protection levels vary by species. For example, marsupials give birth to underdeveloped young that continue developing in a pouch. Maternal health, nutrition, and toxin exposure can still affect fetal well-being.