Whatever energy is produced and put onto the power grid is immediately consumed. You can't overproduce and waste the extra somehow. If lots of people in a city all suddenly turned on their TVs at the same time (stuff like that happens), then the voltage momentarily sags as the regulator on the generator lets more steam or water or whatever thru the turbine. There are also phase issues and frequency issues. It gets messy, but no matter what, all produced energy is immediately consumed.
Solar and wind generators produce what they produce, mostly. These producers are currently a small fraction of the overall power, so the rest of the producers adjust accordingly. This is actually a significant problem with power grids as the fraction of producers with relatively sudden fluctations (like wind and solar) increases. Currently, for each grid, the main controlling authority attempts to rebalance the producers with demand every 4 seconds. There are various pricing structures in place so that those that can react quickly can charge more. The output of nuke plants, for example, can only be controlled very slowly. Hydro plants can generally respond "quickly" in this context. Other types are in between. On the flip side, nukes produce electricity more cheaply. Everything is a tradeoff. Generally the nukes are used to provide the base load, with faster fossil fuel plants providing the daily ups and downs.
Even though every bit of power produced is consumed immediately, some of these consumers can store energy and then act as producers later. This is generally not done second by second, but mostly for the purpose of leveling demand (as seen by the large and slowly varying producers) over day/night cycles. There are systems that pump water uphill. See for example the Northfield Mountain station in north-central Massachusetts.
I said that short term storage is not generally done, but there are attempts at it. One example is a flywheel system by Beacon Power. Electronics controls whether power is being dumped onto or taken from each flywheel, so can respond very quickly. Such a flywheel farm is not meant for leveling the day/night cycles, but the short term demand changes measured every few seconds. A flywheel farm can handle the fast demand changes, while other plants are reacting to the slower average demand changes.