What is the difference between body waves and surface waves, and between P-waves and S-waves?

Body waves travel through the interior of the Earth. On the other hand, surface waves propagate only at the interface between two different media, like the interface between Earth and atmosphere (i.e. the surface of the Earth).

Body waves are of two types: Primary waves (also called P-waves, or pressure waves) and Secondary waves (S-waves, or shear waves).

P-waves are compression waves. They can propagate in solid or liquid material.

S-waves are shear waves. They only propagate in solid material.

By studying the trajectories of S-waves, scientists could prove that the Earth had a liquid outer core.