It's called refractive/reflective seismology. S waves will not travel through liquid though P waves will. So if we look at a seismograph that shows at a point S waves stop but P waves continue on we know that there is a liquid there. Further, we can use Snell's law to define geologic interfaces beneath the surface by looking to see how and where these seismic waves refract or reflect.