Alot of the heat comes from radioactive decay. Heavy radioactive elements under alot of pressure and heat. There's also friction from our moon (earth seems to have a more active core than many other planets) and simply being very well isolated. (Rock is a terrible heat conductor)
Also... Iceland. They're massive in aluminium production for a reason. They have basically infinate abundant energy boiling out from the ground. Here in sweden its used by alot of homes for heating; getting a well producing 60c water is pretty cheap. (A single home may have their own well)
The issue is using it for power really only becomes viable when you reach superheated steam temperatures. And at those depths; drills melt, so its use outside of volcanic regions has been real slow.