A pearl is a hard, glistening object produced within the soft tissue (specifically the mantle) of a living shelled mollusk or another animal, such as fossil conulariids. The ideal pearl is perfectly round and smooth, but many other shapes, known as baroque pearls, can occur. The finest quality of natural pearls have been highly valued as gemstones and objects of beauty for many centuries. Because of this, pearl has become a metaphor for something rare, fine, admirable and valuable.

The mollusk's mantle (protective membrane) deposits layers of calcium carbonate (CaCO3) in the form of the mineral aragonite or a mixture of aragonite and calcite (polymorphs with the same chemical formula, but different crystal structures) held together by an organic horn-like compound called conchiolin. The combination of aragonite and conchiolin is called nacre, which makes up mother-of-pearl.

The commonly held belief that a grain of sand acts as the irritant is in fact rarely the case. Typical stimuli include organic material, parasites, or even damage that displaces mantle tissue to another part of the mollusk's body. These small particles or organisms gain entry when the shell valves are open for feeding or respiration. In cultured pearls, the irritant is typically an introduced piece of the mantle epithelium, with or without a spherical bead (beaded or beadless cultured pearls).

More Info: en.wikipedia.org