Fundamentally, Grid operators have to realtime-match demand + generation, and have a bunch of grid-scale devices along the way to sink excess generation temporarily, or have (expensive) peaker plants to ramp up generation temporarily. For example, natural gas can respond quicker to demands, but nuclear power plants typically cannot. Typically nuclear plants will feed into the average 'base load' and the more responsive plants will handle temporary peaks.
In order to financially make this work, there are a whole litany of agreements + commitments in place, as well as some "free market magic". (Remember a few years ago when spot prices for electricity spiked into obscene territory?)
Renewables provide unique challenges for these operations, as you cannot simply turn sun and wind off and on. Similarly, you can't just pump uncontrolled electricity into the grid w/o the operator's coordination.