AC distributions grids are indeed not just simply like batteries.
The cables that feed grid power to your house simply look like a very low impedance AC voltage source. Nothing you can do can affect the grid voltage or frequency (apart from resistive losses on cable going to your house) because the grid has gigawatts of power running trough it.
So what the solar inverter does is actually send current into the grid that has the same sine shape and phase as the voltage on the grid. It could actually send any shape and magnitude of current into the grid and the current would just flow into it, but doing so would not deliver power into the grid efficiently, so your electricity meter wouldn't count all of it, also likely breaking the contract you made with the electrical company that requires you to send power into the network with a sufficiently high power factor (a measure of how in phase sine shaped your power is), so they can sue you or disconnect your service. This is because sending power in this inefficient current shape causes extra losses in the electric companies power network.
Now when you plug in a resistive load (like a heating element) it will also take a sine wave shaped current from the grid, but this one is flowing in the opposite direction, so the electricity meter counts that as taking power from the grid. If you also have an inverter running, this means it cancels out the current produced by the inverter and lowers it by that amount.So if both currents are say 10A then they cancel out completely leaving 0A to be sent out to the grid. Hence the electricity meter has 0A flowing trough it hence it is counting 0W and 0kWh. If the inverter is producing 15A and the load is still using 10A then that leaves 5A of current that needs somewhere to go, because there are not enough loads to use it up the only direction it can flow is out to the grid via the meter so it will measure those -5A or -1200W, counting that as power sent to the grid.
The result your power does in the grid is those 5A flow trough the wires back towards the distribution transfer, canceling out more loads along the way until it is used up. This means the distribution transformer doesn't have to supply the 5A you gave to it, so it will also draw those 1.2kW less on the high voltage line feeding it. This means the power plant feeding that high voltage line will also see 1.2kW less load, so the generators in that power plant will take 1.2kW less power to spin, so the control system there will have to close the valves slightly to let slightly less steam into the turbines. If it didn't do that the turbines would keep trying to spin the generator at the same power but nothing is taking the power, so the leftover power stays as kinetic energy going into spinning the generator faster and faster. This would raise the mains frequency from 50Hz to 51Hz then 52Hz etc.. This doesn't actually happen because the grid is carefully controlled to make sure this does not happen and also it takes a LOT of power to make all generators in Europe to spin faster by any measurable amount.