A geothermal heat pump takes geothermal energy (e.g. from the ground of a building) to produce the heat required for the heating and the warm water of a house.
The idea is to pump a fluid in the ground which evaporates by the geothermal heat of the ground (adiabtic state change).
The heat pump transforms the gas into a liquid again using a compressor and reuses the heat energy which is produced in this process step.
Electrical energy is to run the components of the heat pump e.g. the motors of the pumps and the compressor.