Minerals are formed under a variety of conditions, including when molten materials cool, when liquids evaporate or cool and under high temperatures and pressures. Minerals are found in the earth's crust and mantle, and many were created when feldspar and quartz reacted with other materials during the formation of the planet.
Igneous rocks come from magma underneath the surface of the earth. This magma is mostly silicon and contains other elements, such as oxygen, aluminum, calcium, sodium, potassium, iron and magnesium. When magma cools, these rocks harden after water and carbon dioxide are removed from the minerals.
Some sedimentary rocks form after seawater evaporates. Sodium chloride, commonly known as table salt, and calcium sulfate, or gypsum, are two common minerals created after seawater evaporates due to warming by the sun. These minerals are often found in dry, arid places where evaporation temperatures are high.
Diamonds form after coal is superheated and put under intense pressure. Diamonds are created as low as 100 miles below Earth's surface in the mantle. Kimberlites and olivine also form in the mantle and are thrust closer to the surface due to tectonic processes. Other metamorphic rocks and minerals change into gemstones under high heat and pressure, such as jade, emeralds, opal and tourmaline.