The idea that sharks will drown if they stop swimming is a common one, but it's not entirely true. There are two main ways sharks go about breathing. Ancient shark species breathed through a method called buccal pumping, which some of today's sharks still use. Muscles around the sharks' mouths actively pull water in, sending it over their gill membranes and out the gill slits. The sharks absorb oxygen from the water as it passes by. Lots of sharks that have adapted to bottom feeding use this method.
Many modern sharks breathe through a technique called ram ventilation. By swimming fast, these sharks actively force water into their mouths for processing. Usually, sharks that get their oxygen through ram ventilation can also change techniques if they need to. If they're idling, they'll use buccal pumping, but when they pick up speed, ram ventilation takes over.
Some sharks' muscles aren't strong enough to actively pump water, though. Called obligate ram ventilators — or obligate ram breathers — these sharks are the ones rumored to have to swim constantly to stay alive. In the past few decades, however, researchers have seen obligate ram breathers taking the occasional pit stop. For example, scientists have documented some species basking in underwater caves or on sandy seafloors, sometimes solo and sometimes in groups.
It's unclear how these species cope with what seems like a sudden drop in oxygen. These resting ram breathers may have scouted out caves where the water had high oxygen content and lower than average salinity. In other cases, how they managed was less apparent, but the even greater mystery — for now at least — seems to be why a shark would take a breather that could keep it from breathing.