How does a solar / PV inverter get preference over grid source for the house load?
Consider the following thought experiment. Suppose we have a circuit with an ideal voltage source, and ideal current source, and a resistive load, as in the following schematic.
simulate this circuit – Schematic created using CircuitLab
By Kirchhoff's Voltage Law (KVL), the voltage across Rload is equal to the voltage supplied by V1. The amount of current that I1 is capable of supplying has no bearing upon the voltage across Rload.
By Ohm's law, the current through Rload is
$$I_{load} = \frac{V_1}{R_{load}}$$
By Kirchhoff's Current Law (KCL) the current supplied by the voltage source + the current supplied by the current source, equals the current through the load. If the current supplied by the current source is less than the current drawn by the load, then current will flow out of the voltage source V1. That is, the voltage source will supply the deficit in current that the current source is unable to supply. If on the other hand, the current supplied by the current source is more than the current drawn by the load, then current will flow into the voltage source V1. In other words, the current source will "export" its surplus current to the voltage source. Note that V1, assuming it is a fixed voltage, has no "say" in how much current it supplies to the load (if any) nor whether it will receive "excess" current from the current source I1.
Now, in real life, the grid is not an ideal voltage source, but it can be, with some inaccuracies, approximated as an ideal voltage source. That is, the voltage supplied by the grid remains relatively constant despite changes in load current. Again, that is only an approximation.
Also, in real life, a grid-tie inverter is not an ideal current source, but if it is designed well, it behaves in a very similar way to the ideal current source in the thought experiment circuit.
I hope this thought experiment gives you intuition about how the grid-tie inverter is able to preferentially supply current to the load, and how excess current will be routed into the the grid. Now I am going to add some detail about the grid-tie inverter.
Although the details of the construction of an inverter will vary from model to model, a near universal feature will be an inductor (possibly "hidden" by a transformer) on the output side of the inverter. Over a small enough time frame, an inductor acts similar to an ideal current source. That is, it wants to output a specific current regardless of load. The amount of current actually changes with time, but over a short time-span, it can be treated as if the current is fixed. The rest of the grid-tie inverter is designed to control the current through the output inductor, through fast switching of a semiconductor. (The inverter is also designed to limit the voltage generated by the inductor in the case that grid power is lost -- one of the features of both an ideal current source and a real inductor is that if there is an insufficient sink for the current that the device wants to "push", the voltage can rise precipitously.)
This answer skips over many real world details, such as reactive power, which play a role in the power sharing between the grid and a grid-tie inverter. But hopefully, this answer gives you some intuition regarding how it is possible that the current drawn by a load may be preferentially supplied by a grid-tie inverter, rather than via the grid.