Sound is a form of energy produced and transmitted by vibrating matter. Sound travels in waves. When sound moves through matter (solid, liquid, or a gas), the molecules of the matter move backward and forward in the direction in which the wave is traveling. This movement is called a vibration.
As sound waves travel, molecules are pressed together in some parts compression) and in some parts are spread out (rarefaction). When a loud sound is heard, it is because many molecules have been vibrated with much force. A soft sound is made with fewer molecules being vibrated with less force.
Sound travels more quickly through solids than through liquids and gases because the molecules of a solid are closer together. Sound travels the lowest through gases because the molecules of a gas are farthest apart.
In a vacuum sound cannot travel because there is no matter for it to move through.