"water leaves the eggs during the last weeks of incubation because of the internal heat generated by it's rapidly developing fetus. the egg becomes slightly warmer than the surroundings and that, in turn, causes a directional osmosis that pulls water out of the shell. "
this was a quote taken from
ball pythons, pythons of the world vol. 2, by David and Tracy Barker (VPI)
(this is a great book with tons of information)
when this happens there is a reduction in pressure inside the egg, causing it to dimple or even collaspe, this is a normal condition during the last few weeks of incubation.