The classic protective mechanism for this is big fuses.
Classic manual synchronization of a generator involved three lamps, showing the voltage difference between the phases of the generator and the grid. The operator has to adjust the speed of the generator until all lights stop flickering and go out. Here's that being done with a desktop training setup.[2]
Because this is a touchy operation to do manually, it's usually automated. However, there's no reason you couldn't have a hard wired interlock so that the breaker won't close until all three difference voltages are low enough.
But it's so tempting to cut costs and put all that functionality into one convenient package. Like this one.[3]:
The SEL-700G is the right solution for utility and industrial generator protection, with an autosynchronizer, flexible I/O, and advanced communications. It provides a complete protection and synchronization solution for synchronous generators, so you can eliminate the complexity and cost of standalone synchronizer packages. Integrating the synchronization capability into the generator protection relay provides the most cost-effective and reliable solution.
The 5-inch, 800 x 480 color touchscreen display option allows you to directly set, monitor, and control your system, including up to five two- or three-position disconnect switches. A small form factor and multiple mounting adapters make it easy to upgrade protection without cutting or drilling existing cutouts. You can quickly integrate the SEL-700G into serial or Ethernet-based communications with IEC 61850 Edition 2, EtherNet/IP, the IEEE 1588 Precision Time Protocol (PTP), IEC 60870-5-103, the IEC 62439 Parallel Redundancy Protocol (PRP), Mirrored Bits communications, Modbus, DNP3, and other protocols.
What could possibly go wrong?
[1] https://youtu.be/FI_07YVS3tY