How does geothermal energy work