Ground-source heat pumps (with a few exceptions and borderline cases like those mentioned in the article) are not sources of heat, so you can only "get heat from" them in the short term; as with a battery or an interest-free checking account, though you may be able to temporarily run a debit balance, in the long run you can only get out what you put in.
This is a fundamental difference from energy sources.
Energy storage is an important complement to energy sources, especially renewables, and can substitute for energy sources to a limited extent, but confusing them is a fatal error.
Ground source heat pumps as used for heating buildings source their energy from the sun and work very well. They are outcompeted by air source heat pumps despite better efficiency because digging is expensive.
As I understand it, no, they do not source their energy from the sun. You have to bury the pipes below the frost line. In temperate climates, the frost line is the place where the earth is so well insulated from the surface by the thickness of earth above it that heat conduction is insufficient to freeze it throughout the entire winter. The sun only heats that surface by radiation.
> Unlike air-source heat pumps that struggle to extract heat from frigid air, ground source heat pumps tap into a remarkably stable heat source: the earth itself. Below the frost line, ground temperatures remain relatively constant year-round, typically between 50-60°F (10-15°C). This consistency makes ground source heat pumps highly efficient even during the coldest months.
If you were building a ground-source heat pump to heat your house in the summer, you could get away with burying the pipes at a much shallower depth and in effect converting the earth into a low-temperature passive solar collector. But generally people want to heat their houses in the winter instead.