Twenty wriggling tawny sharks (Nebrius ferrugineus) were recently caught on video undulating on a beach on Mer Island, Australia.

But why were the sharks shimmying in the sand? Though the sharks were gathered in shallow water, they weren't stranded or in distress. Rather, their sinuous moves dug up tasty marine clams known as pipis (Paphies australis, the name "pipi" comes from the Māori language), which were buried in the wet sand.

Local resident Willam Bero filmed the scene and shared the footage on YouTube on Jan. 23. The sharks typically visit beaches on Mer Island beginning in September to perform this "dance" as they feast on the small clams, Bero told local news site Tropic Now .

Related: 7 unanswered questions about sharks

When Bero started filming, the writhing sharks were clustered together, thrashing their tails close by the shore. Some of the fishes' bodies were completely out of the water, as though they had beached themselves accidentally.

But, in fact, the sharks were waiting for the tide to recede and the shellfish to poke out of the sand, Bero told Tropic Now.

"What happens is, they sit and wait for the pipi shells to come up," he said. "When the tide is at a particular point, the pipi shells emerge."

Tawny sharks go by many names; they're also known as nurse sharks, spitting sharks, rusty sharks and sleepy sharks, according to the Florida Museum . They can grow to be up to 10 feet (3 meters) long. In addition to clams, their diet includes fish, sea snakes, and marine invertebrates such as sea urchins, crustaceans and cephalopods. The sharks search for their prey along the seafloor and use powerful suction to hoover up the small animals, according to the Florida Museum.

After about a minute of on-camera feeding, the tawny sharks at Mer Island wriggled back into the water and swam away. Only the sharks could say if they were satisfied with their meal, but it would take a lot of pipi to fill a shark's belly; each of the shellfish measures no more than 3.3 inches (8.3 centimeters) long and 2 inches (5.1 cm) wide, according to the Atlas of Living Australia .

Originally published on Live Science .