Here's why:
* Heat: The Earth's interior is extremely hot, and this heat can melt rocks.
* Pressure: The immense pressure deep within the Earth also plays a role in lowering the melting point of rocks.
When magma erupts onto the Earth's surface, it's then called lava.