They erupt due to the heat underground because of magma, building enough pressure for water to hit it's boiling point. When the pressure causes the water to come to the surface, the pressure is released cause a massive boil over, This ejects all the water in the reservoir to the surface in a boiling plume, creating a geyser