Human divers need to resurface very slowly to avoid dangerous 'gas embolisms' which lead to decompression sickness (a.k.a. The Bends).
Deep-diving animals - e.g. whales, dolphins, turtles etc do not suffer the same problems (or very rarely do). There is currently no explanation.
A 2018 paper in Proceedings of the Royal Society B reviews the current research and suggest a possible mechanism.
“While exposure to high pressure is a common challenge among breath-hold divers, there is large variation in respiratory anatomy, function and capacity between genera and even species. The ultra-deep-diving feats of some marine mammals go beyond our current understanding of respiratory physiology and lung mechanics.”