The recent international agreements signed by the majority of developed countries, such as those reached at the Climate Change Conferences in Paris'15 and Dubai'23, propose an increasingly rapid transition toward an energy ecosystem with a clear predominance of renewable energy in electrical power systems. The development of such ambitious energy programs should deal with the inherited stochasticity that renewable energy systems entail, which, when coupled with uncertainty about the capacity of the grid to maintain a power supply owing to increasing demands, decarbonization processes and the widespread closure of nuclear power plants, pose a serious threat to the normal functioning of energy systems. When combined with the escalation of armed conflicts that imply the loss of supply as a result of attacks or cyberattacks on power plants and distribution networks, it becomes clear that the current energy paradigm in which there is a centralized grid supplying numerous consumers, many of whom do not have their own generation capacity, must shift toward increasing the deployment of renewable-energy-based self-consumption facilities. The continuous advances toward a decentralized energy system of this nature will also lead to more cooperation, increasing the presence of energy communities with a great need to strengthen internal resilience as a sustaining factor. Considering the challenging framework of smart grids and energy transition, Microgrids would appear to be the key technology for the aggregation of generation, load and energy storage systems, and a cornerstone with which to provide the resilience and flexibility required for this new renewable-energy-based scenario. In addition to the complexity of the microgrid control problem, the issue of resilience energy management also has to be considered, which refers to the ability to adapt and supply loads during a specified period after a disruptive event with a loss of grid supply.