How Cavities Form