Here's why:
* P waves (Primary waves) are compressional waves that travel through solids, liquids, and gases. They move faster than S waves.
* S waves (Secondary waves) are shear waves that can only travel through solids. They are slower than P waves.
Therefore, since P waves travel faster, they reach the seismograph before the S waves. The difference in arrival time between the P wave and the S wave is used to determine the distance to the earthquake epicenter.