Magma develops within the mantle or crust when the temperature-pressure conditions favor the molten state.