Good luck with solar in Germany when you will be paying a fee for feeding in energy to the grid during solar peek time from 2027 onwards.
So yeah the cost is in moving and storing the electricity by maintaining and expanding the infrastructure.
So if there's additional power available and they don't want to give it away for free, they turn on those heaters and boost the temperature of the water that is used for showering etc.
For a four person household these things are around 200 to 300 liters, so you can put a few kWh in them that you can save a day or two later.