How does peak shaving work?

Peak shaving means reducing the highest electricity consumption in a given period of time. This is done by using temporarily stored energy during peak hours. This reduces peak grid consumption and saves energy costs.