What sequence of events could lead to magma becoming soil?