Emeralds are formed deep within the Earth's crust under intense heat and pressure. They are typically found in metamorphic rocks that have been subjected to high temperatures and pressures, such as schist and gneiss. The formation process can take millions of years and requires specific geological conditions to occur.