Are you talking about geo thermal? Not quite accurate in your explanation.
All it is, is using the earch as a heat exhanger, and a heat pump.
Anyone needs info on this, I have lots as I looked into my drilling license here in TX for about 3 months ago.
You aren't actually moving anything out of the ground....just heating a liquid, usually an oil base or something similar inside a pipe. So one pipe is the sleve, the other is the smaller pipe with the fluid. The ground heats up the fluid and it is circulated through the heat pump, this will both heat and cool depending on whether ground is warmer or cooler than surface ambient temp.
Thermostats built into heat pumps on the higher end units will open and close automatically when a desired temp is reached.
Now don't crucify me here....this is a really really simplified version of how it works. It IS NOT a DIY guideline. DO NOT start digging a hole based on this. There's a reason it cost $4k here for an apprenticeship and at least 2 years on hands experience to be qualified, and you must pass the state's tests. This is just the super big bird version of it. I hope I didn't skip anything.