The last decade has seen a rapid growth in our understanding of the microscopic origins of shape coexistence, assisted by the new data provided by the modern radioactive ion beam facilities built worldwide. Islands of the nuclear chart in which shape coexistence can occur have been identified, and the different microscopic particle–hole excitation mechanisms leading to neutron-induced or proton-induced shape coexistence have been clarified. The relation of shape coexistence to the islands of inversion, appearing in light nuclei, to the new spin-aligned phase appearing in N=Z nuclei, as well as to shape/phase transitions occurring in medium mass and heavy nuclei, has been understood. In the present review, these developments are considered within the shell-model and mean-field approaches, as well as by symmetry methods. In addition, based on systematics of data, as well as on symmetry considerations, quantitative rules are developed, predicting regions in which shape coexistence can appear, as a possible guide for further experimental efforts that can help in improving our understanding of the details of the nucleon–nucleon interaction, as well as of its modifications occurring far from stability.