In this Letter, we develop a continuum theory for the Cassie-Baxter-Wenzel (CB-W) transition. The proposed model accounts for the metastabilities in the wetting of rough hydrophobic surfaces, allows us to reconstruct the transition mechanism, and identifies the free energy barriers separating the CB and W states as a function of the liquid pressure. This information is crucial in the context of superhydrophobic surfaces, where there is interest in extending the duration of the metastable superhydrophobic CB state. The model is validated against free energy atomistic simulations.