If you ever find yourself in the Maldives laying on a gorgeous white sand beach, thank a parrotfish. They built that beach for you, though you might not like the way they did it. 

The islands of the Maldives are what are called coral islands, built from piled-up pieces of coral and other sediment that originate from nearby reefs. How do all those bits and pieces break free to build a beach? Geologist Christ Perry found that, in the case of at least one island, Vakkaru, the sediment can mostly be traced back to two species of parrotfish.

Parrotfish get their name from their peculiar teeth, which are fused together and resemble a parrot’s beak. They use these chompers to scrape and grind away at coral reefs to get at the algae and coral polyps that they eat. More teeth at the back of their throats pulverize the coral into sand, which is passed through in the fishes’ feces and eventually builds up in piles. Parrotfish can eat tons of coral in a year, so they’re an important source of this sediment. At Vakkaru, Perry and his research team found that the local parrotfish produce around 1.5 million pounds of sediment each year and contribute some 85 percent of what goes into building and maintaining the island’s beaches.

Since the Maldives are very low-lying and vulnerable to sea-level rise, the researchers say that maintaining and protecting the parrotfish that live around them is critical to keeping them above water.