Controlling electrical flow from generator
Can a source power two circuits while keeping them isolated from each other?

Not when running from the same generator but that's not how you would do it anyway.
What you are proposing is quite common in countries with reliable energy supply but where peak demand is on the edge of system capacity. Industrial users with generation capacity can sign up to receive payment for being available for remote start-up and power generation. Going online requires the following operations:

Start of generator engine. This can be manual or remote or automatic.
Adjustment of output voltage to match grid voltage.
Adjustment of frequency to closely match the grid frequency.
Wait until the voltage between the generator phase and the grid phase drops to zero then close the connecting breaker.
Now ramp up the generator power.

You are now pushing energy into the grid. Since your load is the closest it will draw the power it requires and the rest feeds into the grid.

where will those new electrons go?

Forget electrons. They just oscillate back and forth in AC and don't &quot;go&quot; anywhere. Think of current.

The resistance of the grid will be effectively infinite (when compared to the factory or the generator), ...

Nope. The resistance of the grid is close to zero. That's why the lights don't dim much when you switch on your big loads.

... so the natural route would seem to be factory. Which would mean the generator fries the factory's circuit and feeds almost nothing to the grid.

Nope. You'll only need a couple of volts higher than the no-load mains voltage to start exporting power.

Figure 1. A synchronisation setup. Source: CircuitGlobe.
I did this in college many years ago where we had a machine (the incoming machine of Figure 1) driven by a DC motor. We ramped it up and all three lamps start blinking slowing down as the difference in frequencies gets smaller. When the lamps go out there is no voltage across the contacts so they can be closed without arcing. We then applied power to the DC machine to generate power and feed back to the grid. A following exercise was to reduce the DC machine drive and then switch it into reverse and ramp up the power to act as a brake on the AC machine which then imported power from the grid to act as a motor. It was a most educational experience.

See also G59/G10 relays.

Commonly known in the UK as G59, and as G10 injection testing in the Republic of Ireland, these regulations apply to power plants and generators used for standby and peak lopping application, or grid parallel use.
G59/G10 testing assesses the performance of the mains protection relay that sits between the generator and the electricity grid. It’s not a test of the generator itself. The relay’s purpose is to disconnect or “decouple” the generator from the electricity grid if it detects instability on either side of the connection.

Source: G59/G10 injection testing by Edina.