Thus, sound passes more quickly through the wood, which is less dense. Suppose, however, that two substances are made of different molecules which weigh the same amount. They have the same volume, but one substance is more dense. We know the denser substance must have more mass per volume. Since both substances have molecules of similar weight, this extra mass means the denser substance has more molecules per volume.
More molecules are squeezed into the same volume, therefore the molecules are closer together.
Since sound is more easily transmitted between close molecules, it travels faster in the denser substance. Sound moves faster through denser air because the molecules are closer together in dense air and sound can be more easily passed on.