Lapis lazuli is a rock, not a mineral, an aggregate whose blue comes from lazurite, with white calcite and brass-coloured pyrite as the usual accessories. Lazurite is a sulfur-bearing sodium calcium aluminosilicate, and the colour derives from trisulfide radical anions trapped in the crystal framework, which is an unusual colouring mechanism and the reason the blue is so saturated and so stable.
The economically decisive fact is that for most of history there was essentially one source: the mines of Sar-i Sang in Badakhshan, in what is now northeastern Afghanistan, worked since at least the fourth millennium BC and still worked. Lapis found in the Royal Cemetery at Ur in Mesopotamia, in Egyptian tombs including the funerary mask of Tutankhamun, and in the Indus Valley cities all came from those mountains. The distances are enormous and the trade is one of the best-documented long-range exchange networks of the Bronze Age, traceable precisely because the material is visually distinctive and the source is effectively unique.
Lapis was also the raw material of ultramarine, from ultramarinus, from beyond the sea, the most expensive pigment in European painting. Grinding lapis gives a disappointing grey; the extraction of pure blue required a laborious process of kneading the powder in wax and resin under lye, described by Cennino Cennini in the fifteenth century. The cost was such that ultramarine was specified by contract, priced separately from the painter's fee, and reserved for the Virgin's robe. A synthetic equivalent was produced in 1826 after a prize competition, which collapsed the price and ended the pigment's economic significance.