system
Given the following post, respond as if you're commenting on Reddit:
human
How does magma ascend miles and miles and goes through solid rock, eventually reaching the surface?

I really have no idea how this happens.
gpt
Magma is buoyant. Simple as that. It's basically made of the same stuff as the crust, but a thousand degrees C hotter.

It usually travels by fracturing rock and injecting itself into the cavities formed by the excess pressure, or it can simply melt surrounding host rock.

When it gets closer to the surface gas starts to come out of solution as the pressure drops, which expands, often causing sharp pressure increases, the force of which can drive particularly high-energy eruptions.