Who would cover the electricity difference if the generator does not
end up producing the quantity stated in the trade or where would the
overproduced electricity go, if the consumer has estimated his
consumption poorly?
This is why continuous grid management is needed.
Electricity in the grid in most cases cannot be stored for later use. It is a good approximation to assume that at any instant the electric power consumed is exactly equal to the electric power produced.
As you know, there are different ways to generate electricity. Some of them are almost 100% predictable (e.g. nuclear power plant), others are not (wind/solar).
The challenge for grid management is now to first try and predict production and consumption for a certain period, then to acquire the predicted needed amount of production capacity for that period, and then to keep monitoring fluctuations in production or consumption, i.e. deviations from the predictions, and react on those fluctuations by adding or removing electricity production (sometimes also consumption) as quickly as possible.
This is done by employing a certain mix of power producers: A nuclear power plant takes significant time (hours maybe) to significantly increase or decrease power output, wind/solar can very quickly (seconds) be taken off the grid, but e.g. at night solar power cannot be requested to generate some extra power to accomodate increased demand. Gas-powered power plants can be regulated up or down relatively quickly and are thus in demand exactly to fill the gap between the constant base load of the big (e.g. nuclear) power plants and consumption which may vary faster than a nuclear plant could accomodate.
The whole thing works very much along the basic economical model, putting a certain price to a certain risk.
Nuclear plants produce cheap electricity, but are in-flexible. Solar/wind is also not very flexible. In fact, solar and wind energy are a grid operator's worst nightmare and they're not even cheap but are usually subsidized and otherwise politically encouraged. Gas is more flexible than nuclear and more controllable than solar/wind, but also more expensive per unit of energy (Joule, Wh,...) produced than nuclear and disliked due to CO².
Bottomline: Grid operators try to get the cheapest electricity they can, but at the same time they absolutely must make sure to always be able to adjust production to varying, unpredictable consumption (or production), because at every instant power supplied to the grid exactly matches the power taken from the grid. If they try and supply more or less than is actually demanded, installations connected to the grid will malfunction (under-supply, i.e. under-voltage) or be destroyed (over-supply, over-voltage). That's just physics.