It’s not possible for supply and demand to exactly match at all times. There is always a mismatch. Demand and supply of electricity mismatch within the power grid needs to be within a certain limit, or the grid might collapse leading to power outages.
Frequency Regulation ensures the balance of electricity supply and demand at all times, particularly over time frames from seconds to minutes. Energy storage can help maintain this frequency by absorbing energy during periods of high supply and sending back energy during periods of high demand.