Natural vernix caseosa contains a mixture of fatty compounds that waterproof the fetus.
From the buffalonews.com
Newborns are wet, covered in streaks of blood, and coated with a white substance known as vernix caseosa, which is hypothesised to act as an antibacterial barrier.