Crystals grow when molecules that are alike get close to each other and stick together, forming chemical bonds that act like Velcro between atoms. Mineral crystals cannot just start forming spontaneously – they need special conditions and a nucleation site to grow on. A nucleation site can be a rough edge of rock or a speck of dust that a molecule bumps into and sticks to, starting the crystallization chain reaction.
At or near the Earth’s surface, many molecules are dissolved in water that flows through or over the ground. If there are enough molecules in the water that are alike, they will separate from the water as solids – a process called precipitation. If they have a nucleation site, they will stick to it and start to form crystals.