The role of the alkali metal cations in halide perovskite solar cells is not well understood. Using synchrotron-based nano-x-ray fluorescence and complementary measurements, we found that the halide distribution becomes homogenized upon addition of cesium iodide, either alone or with rubidium iodide, for substoichiometric, stoichiometric, and overstoichiometric preparations, where the lead halide is varied with respect to organic halide precursors. Halide homogenization coincides with long-lived charge carrier decays, spatially homogeneous carrier dynamics (as visualized by ultrafast microscopy), and improved photovoltaic device performance. We found that rubidium and potassium phase-segregate in highly concentrated clusters. Alkali metals are beneficial at low concentrations, where they homogenize the halide distribution, but at higher concentrations, they form recombination-active second-phase clusters.