Sea water especially: it corrodes the contacts while you are still reaching for a towel.
Three things that will kill an iPhone faster than depth: 📵 Do not turn it on. The temptation to check whether the screen is alive is the main killer. Any press of a button sends current through wet traces. 🌬️ Do not dry it with a hairdryer and do not shake it. Hot air drives moisture deeper, and shaking spreads salt water across the whole board. 🍚 Do not bury it in rice. That is a myth from 2007 that works worse than simply putting the phone on a table.
The right scenario: switch it off, rinse it with fresh water (yes, that sounds strange — but salt is worse), and bring it to a professional before the board gets covered in white residue. The faster you get to a technician — the higher the chance that the device gets off with a scare and a clean, rather than a replacement of half its insides.