1 You basically have three half bridge sort of arrangements one connected to each phase, feeding inductors, and hence onto a honking great DC bus with plenty of cap.
What you do is drive the switches on the least loaded phase to run as a boost converter transferring power onto the DC link bus, in the simple case with a sinusoidal current waveform, (more on that later), then you drive the other two sets of bridge switches to drive current onto the more heavily loaded phases so as to reduce the load on those phases that the panel presents to upstream. Obviously you can adjust phase angles to improve power factor to taste.
2: Remember the algebraic sum of currents at a node is zero?
If the load is drawing a mess of harmonic current and you want to avoid it heading upstream, you just draw power as a sinusoidal load and put it back as harmonic current in anti phase to the load harmonics.
Now your controls can monitor current on the upstream supply cables (Current transformers) and bus voltage waveform from which computing what waveform must be injected to correct whatever the problem is is a simple matter of an FFT and some trig, and contrary to the fluffer it does not even have to be all that quick, I mean the IGBT pucks are only usually good for a few kHz on a good day, about the only thing faster switches buys you is smaller magnetics.
Sometimes you are going to be correcting power factor, clearly trivial, sometimes moving load from one phase to another thru your energy storage caps, sometimes cancelling current harmonics, or trying to reduce voltage harmonics (Really the same thing but sensing a different input).
The maths is messy, mostly because the parasitics are not negligible, but it is at the end of the day only maths.
Clearly such an arrangement has no actually dissipative elements apart from the parasitic ones so it can be quite efficient, but of course never 100%, and the cables need to be sized for the current, at 200kVA and up that can become significant.
This is all standard, off the shelf tech made by plenty of the usual suspects making real, well engineered gear with real datasheets.