I heard from a professor who designed an electric hot water heater that the heating elements used can sometimes crack, exposing the wire to the water. This caused 240 V AC to flow through the conductive water and piping, and somehow it can cause painful electric shocks to a person using the shower or washing their hands.
What I immediately asked is why not wire a ground to the metal wall of the hot water heater and forget about the problem? Shouldn’t the ground be a much more favorable path for the electric current, going through nice clean metal all the way back to the breaker box? In order to shock someone using a shower, the current has to pass through all that piping, through poorly conductive water, and through a human body to perhaps the metal of the tub which is presumably connected to ground.
That doesn’t sound like a very good circuit path. Path 1 = heater element->a few inches of water -> copper all the way to the breaker box. Path 2 = heater element ->several feet of water-> metal piping ->water stream from shower -> human body -> tub surface or perhaps person is touching a ground.
Anyways, this particular hot water heater uses an electronic circuit to detect AC leakage and cut off the power when it detects it.