In the summer of 2014, Johann Mourier dipped into the waters of Fakarava—a large rectangular atoll in the middle of the South Pacific—and came face-to-face with the highest density of gray reef sharks ever recorded. Hundreds of these sleek, six-foot (two-meter) torpedoes filled his field of view. “It was really impressive, even for someone like me, who’s a shark scientist,” he says.

Fakarava is part of French Polynesia, and the sharks there have been protected from fishing since 2006, hence their staggering numbers. By filming the sharks as they swam through a narrow channel, Mourier’s team estimated that there are anywhere between 250 to 700 of them at the atoll’s southern pass. On average, the area hosts 34 sharks in an area the size of a rugby or baseball pitch.

The team wasn’t worried, though. “During the day, the sharks are very calm,” says Mourier. “They’re just resting and saving energy. If you swim up to them quickly, they escape. At night, they’re active and hunting, and they get into feeding frenzies. But even then, they never bit us. They’re just focused on the fish.” There was only one truly hair-raising moment: when a 13-foot great hammerhead started hunting the gray reef sharks with the divers nearby. “That was a little scary,” Mourier says.

What the sharks lacked in danger, they made up for in mystery. Mourier’s team discovered that, on average, the sharks in the atoll’s southern pass collectively weigh as much as their prey. And that made no sense.

As a general rule, when one creature eats another, it uses roughly 90 percent of the energy it gains to sustain itself and just 10 percent to grow. So less and less energy becomes available the farther up a food web you go. That’s why such webs are almost always shaped like pyramids—the organisms at the bottom (like plants or plankton) collectively weigh much more than those in the middle (like deer and parrotfish), which in turn weigh more than those at the top (like tigers and sharks).

And yet, in the southern pass of Fakarava, the pyramid is more of a rectangle, which means that the sharks shouldn’t be able to sustain themselves. Mourier calculated that the hundreds of sharks would need to eat between 147 and 350 kilograms (324 to 772 pounds) of fish per day to fuel themselves. And on average, there were just 46 kilograms (101 pounds) available daily. So how were the sharks surviving?

To find out, the team first tagged 13 sharks to see if they are regularly leaving the pass to feed elsewhere. In the winter months, between May and October, they largely stay put. In the summer, some go farther afield, but even then enough sharks stay at the pass to swamp their local fish supplies. It’s not that they roam to seek more food, Mourier found. Instead, they wait for gluts of food to come to them.

In June and July, up to 17,000 camouflage groupers gather at the pass to spawn. These large, three-foot fish come from all over the atoll, forming a dense carpet. They each find their own territory, and on two nights of the full moon, they spend a few hours releasing a flurry of sperm and eggs. When that’s done, they return to wherever they came from—or, at least, the survivors do. In the spawning months, the groupers add another 30,000 tons of fish to the pass, and the gray reef sharks can gorge themselves.

The grouper gathering eventually disperses, but other fish take its place. Throughout the year, surgeonfish gather in spawning aggregations with every new and full moon. Between five and 10 other fish species do the same at varying times. That’s how the pass can sustain so many top predators. The local prey may be in short supply, but it’s regularly supplemented by waves of fresh meat coming in from afar. It’s only in the summer months, when those waves get sparser, that the sharks start ranging farther.

Biologists have known that sharks attack fish-spawning aggregations, but most believed that these gatherings just supplemented their regular meals. Mourier’s team has flipped that idea around; without the aggregations, the Fakarava sharks couldn’t exist in such ludicrous numbers.

“This is a very important topic of research,” says Samantha Munroe from Griffith University. “Without understanding energy flow and movement in these environments, it is very difficult to make good management decisions, such when establishing effective marine parks or fishing regulations.”