First, seismic waves have their direction of motion changed (refracted) by variations in the interior density. Thus, by studying the way such waves propagate in the Earth we can learn something about density variations. Second, the fact that P-waves propagate in liquids but S-waves do not allows us to determine if portions of the interior are liquid.

These points are illustrated by this Shockwave movie (Ref).