Due to geological changes. molten rocks formed in the deeper hot region of earth's crust are pushed upward and trapped in certain region- hotspots are formed.
When underground water comes in contact with hotspots steam is generated.
The steam routed through pipe to a turbine and produce electricity.