Similarly, a sound wave in air can go tens and hundreds of kilometers but the air molecules themselves only shift a fraction of a millimeter. Equivalent types of waves occur in solid rock as well. They are compression waves and rely on the compressional strength and elasticity of the materials to propagate. They are known as body waves because they travel though the body of a material in all directions and not just at the surface, as water waves do. For P waves, the motion of the meterial particles that transmit the energy move parallel to the direction of propagation.
P waves travel the same way as sound waves in air.
The transmission of compressional waves is due to the strong electronic between atoms that get squeezed together too tightly. S waves depends on the shear strength of the material. Imagine a very long and narrow block of Jello, and then imagine shaking the end of it and then imagine shaking the end of it from side to side. A shear wave will propagate down the long length of it. You shake it from side to side but the wave travels forward and perpendicular to the direction of shaking.