Sorry Nick but I'm going to disagree here -- assuming all the waveforms are sinewaves and the load is resistive, all the voltages and currents are in phase with each other. If they weren't you'd just get reactive currents flowing from one to the other, for example between inverter and incoming mains, which just increases losses but does nothing to frequency since the mains is effectively immovable. It's definitely *not* about "pushing the phase", this is something you absolutely do not want in this application.
Nothing is zero impedance, either mains source or inverter output, so the currents flowing from each depend on the source impedance and the open-circuit voltages of each. If the load draws no current and both mains and inverter are the same (open-circuit) voltage no current will flow when you connect them together, but when you draw a load current it will split between the two according to their source impedances -- for example if the inverter impedance is double the mains it will only provide one third of the current, not half (or vice versa). To change this (e.g. more current from inverter to share equally) the inverter has to change the open-circuit voltage it generates, for example by increasing it slightly (Kirchoffs and Ohms Laws). It *doesn't* change or lull phase to do this, unless impedances are reactive -- which they probably will be, but that's a different kettle of fish...
This is why it's so difficult to get a system like this working, because the currents flowing depend not just on the voltages but also source and load impedances -- and these are also unlikely to be resistive (including shoreline and battery, when cabling is included) so phase shift comes into it too. The inverter has to continuously measure the magnitude and phase angle of the current it's providing as well as the magnitude of the incoming voltage, and change the amplitude and phase of the waveform it generates internally to provide the required amount of current -- usually while also trying to minimise reactive power (keeping output current in phase with output voltage) since this increases inverter losses.