This thesis addresses some of the challenges that arise when the new smart grid paradigm is applied to power systems. In particular, novel control strategies are designed to deal in a decentralized matter with the increasing complexity of the network. Two main areas are investigated: participation to frequency control of variable-speed wind turbines and management of large populations of competing agents (e.g. micro-storage devices and "smart appliances") that exchange energy with the system. The first part of this work presents two different techniques that allow wind turbines to provide frequency response: following the trip of a large power plant, the turbines population increases its aggregate generated power, reducing the resulting drop in frequency. A first method models the wind turbines as stochastic hybrid systems: the generators switch randomly between two operative modes characterized by different efficiency and generated power at equilibrium. Transitions are driven by frequency-dependent switching functions: single generators behave randomly while large populations perform deterministically, changing the total power in response to frequency variations. The second proposed control strategy allows a prescribed increase in generation, distributing the control effort among the individual turbines in order to maximize the duration of frequency support or minimize the resulting kinetic energy losses. The second part of the thesis deals with large populations of agents which determine their operation strategy in response to a broadcast price signal. Micro-storage devices performing energy arbitrage are initially considered: each agent charges/discharges during the day in order to maximize its profit. By approximating the number of devices as infinite, modelling the population as a continuum and describing the problem through a differential game with infinite players (mean field game), it is possible to avoid synchronicity phenomena and determine an equilibrium for the market. Finally, the similar case of flexible demand is analyzed, with price-responsive appliances that schedule their power consumption in order to minimize their energy cost. Necessary and sufficient conditions for the existence of a Nash equilibrium are provided, extending the results by introducing time-varying constraints on the power rate and considering partial flexibility of the devices.