The driving force that creates crystals is in fact the movement in the earths crust. As layers of crust float on the liquid rock mantle beneath the earths surface, pressure and constant collisions create fractures that allow superheated gases and liquids filled with different elements to escape towards the surface. As these liquids and gasses cool they crystallise.
The temperature pressure surrounding the rocks mix in with different elements and determine which mineral crystallise at a particular place, these types of crystals are known as igneous.
Upon being exposed to the earths elements (wind, frost , and water) crystals begin to erode. Small particles are washed into the seas where they form silt deposits. After many millions of years of extreme pressure, these deposit become compressed, forming sedimentary rocks and crystals, minerals of this type are softer than igneous crystals due to being formed at lower pressures and temperatures.