The melting temperature of materials is affected by the pressure they are under. So when "rock" in the Earth's mantle experiences a decrease in confining pressure, not only does it expand, it's melting temperature drops. If the melting temperature of the material drops below the background (also known as the in-situ ) temperature, then melting will occur and in this case magma will form.