There are four kinds of waves produced by an earthquake. Two move over the surface, causing damage, and two pass through the Earth itself - called body waves.
By studying body waves, scientists worked out what the Earth is like inside: