It is about the difference of temperature, so, being under the sun for long time makes it more risky, even if the water is not so cold.
I added another link that maybe explains it better.
What you mention is also important, “entering water slowly…”
Hasta la vista, baby