This work tackles the problems of understanding how energy is transmitted and distributed in power-grids as well as in determining how robust this transmission and distribution is when modifications to the grid or power occur. The most important outcome is the derivation of explicit relationships between the structure of the grid, the optimal transmission and distribution of energy, and the grid's collective behavior (namely, the synchronous generation of power). These relationships are extremely relevant for the design of resilient power-grid models. To allow the reader to apply these results to other complex systems, the thesis includes a review of relevant aspects of network theory, spectral theory, and novel analytical calculations to predict the existence and stability of periodic collective behavior in complex networks of phase oscillators, which constitute a paradigmatic model for many complex systems.