Oysters make pearls by encasing an impurity in calcium. Outside the oyster, something like a grain of sand may seem perfectly normal and harmless- but once inside the oyster's shell, it becomes regarded by the oyster as an irritant from which it needs to protect itself. So the oyster secretes nacre around the irritant. Nacre is the formal name for the substance of pearls are made. Sometimes referred to as mother-of-pearl, nacre ends up being smooth and iridescent after being dried out in the air, and eventually becomes the gem to which we refer to as a pearl.
There would be no pearl if there was no irritation.
A pearl starts as an impurity. Only later do we understand its beauty.
The irritation happens only internally to the oyster. The pearl only makes sense externally .