The solar panels (photovoltaics) feed the power they generate directly into the mains grid.

But say you are heating your water by ordinary mains electric power and you have photovoltaic panels. At any point in time the sun will be generating an amount of power (anywhere from nothing at night to quite a lot in the full sun). This is feeding into the mains at the same time your are drawing from the mains so effectively it is like using that power for your water heating.

However water heating usually is on a reduced tariff at the time of day when solar is low.

Also you get a much higher rate for net energy sold into the grid at any point in time than for energy ‘saved’ from being used at any point in time. Saved energy (zero net energy into the grid) is paid at the same rate you purchase it. Positive net energy into the grid is paid at about three times that rate.