Multi-engine aircraft aren’t much different from submarines in this regard.
Older multi-engine jets, say airliners from the 707 through the early 737 and 747 used a similar system. Each engine drove an AC generator through a hydraulic pump/motor assembly called a “constant speed drive” or CSD. The CSD tried to maintain a constant output (ie generator input) shaft RPM regardless of engine RPM. That way the generator’s frequency would also be constant, at least within the tolerance of the CSD’s governor.
Each generator was connected to a bus which carried some fraction of the total aircraft load. As well, there was a “sync bus” which connected all the generators together. This enabled the entire system to weather a generator dropping off line with no interruptions in supply to anything as long as total load was below the total output capacity of the surviving generators.
It also meant all the generators had to operate on a common frequency and exactly in phase. After each engine was started there was an elaborate ritual the flight engineer (3rd crewman in the cockpit) had to go through to get the newly started engine’s generator synced with the others before connecting it to the sync bus & the loads.
Each unit had a frequency meter and phase difference lights. You’d adjust the free generator’s freq via a knob while monitoring the meter until it matched the indicated freq of the sync bus, then turn on the phase difference lights & fine-tune the free freq until you had a very slow (1 cycle / 10 sec) beat. Fnally, you’d close the switch at the center of the off part of the blink cycle.
Given that CSDs were mechanical beasts whose behavior depended on temperature, difficulties often arose on frigid mornings & sometimes folks had to wait a few extra minutes for the hydraulics to come up to temp before the situation would stabilize enough to connect sucessfully. Many times there was a little breath-holding when the switch was thrown, since you were holding up traffic & the Captain wanted to get under way NOW. This had to be done for each engine start after the first, so a 707 or 747 engineer had 3 chances to screw up on every flight.
There was a mechanical weak link in the generator input shaft and if you really hosed up & tried to connect when grossly out of sync the link would break. This prevented catastrophic generator damage, which was good, but it also meant the flight was cancelled until it could be repaired and you got to go talk to the boss about your ineptitude. And who knew how many times that link had almost been broken from previous ham-handed connects? So most of us treated those links & connect operations with kid gloves.
More modern designs simply keep each generators’ loads isolated in normal ops & if a generator fails an automatic relay will connect the now-unpowered bus to one of the others which still has a generator. As long as the different busses are generally near correct voltage & freq, ie… +/- 10%, it’ll work fine. The loads see a momentary (<1/10th sec) loss of power, but as long as they’re designed for that possiblity, no problem. No more precise syncing is required.
There are also some uber-modern designs that do away with the CSD altogether & produce AC power of widely varying frequency, say 200 Hz at idle & 450 Hz at full power (400 Hz being the historical standard on aircraft). It requires a little different design for some of the loads, but there was never a strong reliance on exact Hz-itude anyhow, so the changes are comparatively minor.