In this contribution we study the wetting and nucleation of vapor bubbles on nanodecorated surfaces via free energy molecular dynamics simulations. The results shed light on the stability of superhydrophobicity in submerged surfaces with nanoscale corrugations. The re-entrant geometry of the cavities under investigation is capable of sustaining a confined vapor phase within the surface roughness (Cassie state) both for hydrophobic and hydrophilic combinations of liquid and solid. The atomistic system is of nanometric size; on this scale thermally activated events can play an important role ultimately determining the lifetime of the Cassie state. Such a superhydrophobic state can break down by full wetting of the texture at large pressures (Cassie-Wenzel transition) or by nucleating a vapor bubble at negative pressures (cavitation). Specialized rare event techniques show that several pathways for wetting and cavitation are possible, due to the complex surface geometry. The related free energy barriers are of the order of 100kBT and vary with pressure. The atomistic results are found to be in semi-quantitative accord with macroscopic capillarity theory. However, the latter is not capable of capturing the density fluctuations, which determine the destabilization of the confined liquid phase at negative pressures (liquid spinodal).