IP or Internal Protection Code/Ratings are an international standard that refer to the level of protection given to both foreign object intrusion and moisture.
The first digit in the rating refers to the intrusion protection and is rated from 0 (no special protection) through to 6 (No ingress of dust).
The second digit in the rating refers to the moisture protection and is rated from 0 (no protection) through to 8 (Immersion beyond 1m as specified by manufacture).
The Google Pixel 2 and iPhone 8 are IP67 certified. The 6 rating ensures 'No ingress of dust', whilst the 7 rating ensures 'Immersion up to 1 meter in water' with a time specified by the manufacturer (Google state 30 minutes for example).
The Samsung Galaxy S8 however is IP68 certified. Whilst this carries the same ingress/dust protection as the iPhone 8 and Google Pixel 2, the higher rating for moisture protection ensures that it can be immersed in up to 1.5 meter's of water for 30 minutes.