Solar power is the most promising energy source to play a key role in the transition to clean energy worldwide. Scaling solar energy by the required margin requires continuous development towards new concepts and higher efficiencies. Metal halide perovskites have proven their potential for low-cost and highly efficient next-generation solar cells. However, the limited stability of metal halide perovskites currently impedes large-scale commercial applications. The main reason for this instability is the migration of mobile ions during operation, as they are mixed ionic-electronic conductors. The understanding of ion migration is thus crucial for the fabrication of stable and efficient perovskite-based devices. In the first part of this thesis we developed a theoretical model to simulate next-generation solar cells. This model is used to provide realistic estimates of the efficiency potential of next-generation solar cell technologies under realistic outdoor conditions to predict their maximum annual energy yield. Our results provide quantitative insights on how to improve next-generation solar cells. In the second part of this thesis, an experimental technique for the measurement of mobile ions in perovskite-based devices is introduced. We use this technique to quantify mobile ions in perovskite-based solar cells and light-emitting diodes, which provides quantitative insights into the effect of different additives and perovskite compositions on ion migration. These findings will guide future investigations on ion migration and move the research on stable perovskite-based devices from an empirical approach towards a rational development.