A prefluidized sand bed consisting of fine particles compactifies when it is subjected to a shock. We observe that the response depends on both the shock strength and the ambient pressure, where, counterintuitively, at high ambient pressure the compaction is larger, which we connect to a decrease of the static friction inside the bed. We find that the interstitial air is trapped inside the bed during and long after compaction. We deduce this from measuring the pressure changes above and below the bed: The top pressure decreases abruptly, on the time scale of the compaction, whereas that below the bed slowly rises to a maximum. Subsequently, both gently relax to ambient values. We formulate a one-dimensional diffusion model that uses only th...