Lava is hot for two primary reasons:
- Pressure and radiogenic heating make it very hot deep in the Earth (about 100 km down) where rocks melt to make magma.
- The rock around the magma is a good insulator so the magma doesn't lose much heat on the way to the surface.