The function of fontanels is to allow a baby's brain to grow during the first year of life and for the baby's head to pass through the birth canal. Fontanels are the soft areas between the bones of the skull.
By the time an infant reaches 19 months of age, all fontanels should have ossified. Babies have two fontanels: the anterior and the posterior. The posterior fontanel closes within the first few months of life, while the anterior one closes much later. If the fontanels close too early, the baby's brain cannot grow in that direction and will grow in another direction, causing misshaping of the head.
Doctors can tell if a baby is dehydrated by feeling the fontanels. A sunken fontanel indicates that the child needs fluids.