Pearls are produced when an irritant such as a parasite enters a mollusc's shell. The mollusc secretes aragonite and conchiolin that creates nacre (aka mother of pearl) which encases the irritant.