When a grain of sand gets into the craw of an oyster it causes it great pain. So, in order to escape from that pain, the oyster covers the grain of sand with a substance that turns the grain into a pearl. Nowhere does the oyster intend to create a precious jewel.