It seems very complicated, but bringing generators and subgrids into sync is something that network operators do all day long. (Ship engineers too, since they can't rely on shore power for obvious reasons! You can have some very "interesting" outages if you forget to synchronize a newly started generator before connecting to the rest of the ship electricity system.)
I once was on a ship where the engineering dept unadvisedly connected a ~1.5 MW diesel generator to the network when it was out of phase and that shook the entire 6000 ton ship. We later calculated that the whole multi-ton rotor had rotated about 60 extra degrees in under a tenth of a second (in addition to already spinning at 50 Hz), so you can imagine the forces involved with that.
In practice, there will be humongous circuit breakers that trip to protect the equipment.
- if the circuit breakers kick in, you might end up with a huge nationwide blackout. Pretty hard to recover from that - but at least you will recover directly in the new grid.
- if they don't kick in, you get all the generators in Ukraine + Moldova struggling immensely, possibly breaking their encasings/bearings, a little less for Europe, since they would have more mass to resist this spike.
I would have guessed that frequency-synchronicity is sufficient for coupling two grids, and then you could use something like a phase shifting transformer to control the power flow?
[0]: https://en.wikipedia.org/wiki/High-voltage_direct_current#Ad...
Unfortunately, ERCOT decided they didn't want to be subject to the same regulations as the Eastern and Western interconnects, so the project collapsed.
If the grids are particularly far from each other and/or with differing frequencies, a DC high voltage line can be used instead but that is certainly not the most used method.
This does get much trickier if you have multiple connection points and it is impossible to be synchronized at all of them because the in-grid distance between the two points is different on the two grids. Then you definitely do need fancier tricks.
That's more than twice the max diameter of the entire European grid (Tunesia-Gibraltar-Turkey seems the longest path). So as long as there's transformers every few hundred kilometer, and multiple paths between most of the connection points, the overall phase synchronization should be adequate to not need those fancier tricks.
Each generator just matches whatever it sees. If you are trying to match two other generators (like in a triangle, and due to the speed of light it's impossible for all to be perfectly in sync), then it matches to an average of the two, and apparently that works.
Actually syncing up is more of a case of putting in some high resolution meters at the interconnect substation, or maybe some phase shifting transformers, and adjusting the Ukrainian side's frequency by a few micro-hertz an hour until the phase angles are close enough by setting frequency targets at the largest generators. Something similar happens all the time in wide area grids when generators are brought back on line.
Controlling the voltage at the point of synchronization is probably done with tap changers on transformers but would be more complicated to ensure that power flows over the transmission line once it is connected are as desired.