Magma is formed deep within the Earth's crust and upper mantle through partial melting of mantle rocks. This occurs through decompression melting as rocks rise toward lower pressure areas, or flux melting when water or carbon dioxide is added to rocks near their melting point. After forming, magma can intrude into the crust to form plutonic rocks, or erupt at the surface as lava through volcanism. Plutonism describes geological processes below the surface like magma crystallization, while volcanism refers to surface phenomena like volcanic eruptions and hot springs.