system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What are the advantages of pearls to the animals that make them?
gpt
They're basically an immune response.

Oysters are filter feeders, meaning that they draw in water and eat whatevers floating in it. However, sometimes they'll catch a bit of rock or dirt too. If you ever see the inside of a oyster you'll see it's very soft and fleshy, which means that a sharp piece of rock could do real damage to it.

So, it coats the rock in the same material it uses to make it's shell. This smooths over the rock and makes it nice and round and less likely to damage the soft flesh of the oyster.

That we happen to find them pretty is entirely coincidental.