The grid uses AC (not DC), running at 50 Hz (cycles per second). So the voltage is going up and down at that frequency, in a sine-wave pattern.
If you try to connect another generator to the grid, it needs to be at the same point (phase) in the sine-wave cycle, so that its power contribution is added, not subtracted.
If it's not in sync, huge currents can flow, causing damage. Sort of like connecting jumper cables backwards.
The bulk of the power grid is alternating current (AC), and the frequency of the resulting sine wave needs to be synchronized with the other parts of the grid it is connected to.