The interior of the Earth is hot. The centre of the Earth is at a temperature of about 6000 ° C. This temperature is partly a result of heavy materials sinking towards the centre of the Earth, changing gravitational potential energy to heat energy, but mostly a result of natural radioactivity in the interior of the Earth releasing huge amounts of energy.
The heat energy in the interior of the Earth gradually makes its way towards the Earth's surface, aided by convection currents in the mantle. Occasionally volcanoes may erupt, spewing out molten lava, or lava may leak out between tectonic plates as the move apart at certain points on the Earth's surface. At other points heat must escape by conduction through the rocks that make up the Earth's crust. Since rock is a bad conductor this is a very slow process.
At some points, the rocks beneath the surface are hot enough to boil any water that it comes into contact with. The water may form hot pools on the surface. If water can be pumped down to it then it might re - emerge nearly boiling. The water can be used to heat people's houses or generate electricity.