An earthquake wave is a wave due to disturbance within the surface of the earth. It can be caused due to natural causes such as the shifting of tectonic plates and volcanic eruptions.
P-waves are longitudinal waves, which means that the direction of oscillation and propagation are the same. These waves create a series of compressions and dilations.
S-waves are transverse waves, which means that the direction of the oscillation of the wave is perpendicular to its direction.
Due to the high rigidity of the Earth and due to the fact that the vibration and propagation of P-waves are in the same direction, they travel the fastest.