So for a very short stint (felt like way too long tho') I repaired phones for customers. And a lot of what I ran into was "oh, it got water damaged? I don't know how that happened". How I longed to be able to just say to them "go get a water resistant phone".
But how do they actually work? The S5 was given an IP rating and then Samsung had to really say "whoah now" when it was tested, and even Sony (who I consider the real firsts in making IP ratings a 'thing') had to backpedal a little on.
Now the S7 has come out and made the claims again on it being IP68 rated. Wow.
But how does it do it? Youtuber "jerryrigeverything" put together a neat little video on the internals of the device. I found it wholly interesting, maybe you will too.