The propagation of sound is subject to certain conditions. Thus, the transmission of sound requires the existence of a material medium where the vibration of the molecules is perceived as a sound wave. In propagation in compressible media such as air, propagation implies that in some areas the air molecules vibrate when they meet and in other areas they move away, this alteration of distances between the air molecules is what produces the sound. In highly incompressible fluids such as liquids the distances are very little affected but it manifests itself in the form of pressure waves.
The velocity of propagation of sound waves in a medium depends on the average distance between the particles of said medium, therefore, it is generally higher in solids than in liquids and in these, in turn, than in gases. In the void can not propagate the sound, note that therefore the explosions are not really audible in outer space.