P waves are a type of seismic waves and they travel through solid, liquid and gas. They are called P waves because they are faster than the S waves and other types of seismic waves.
The p waves being the fastest is why it was named primary (p waves) while the S waves are slower and are referred to as secondary (s waves). These waves don’t start as surface waves but later results in it.