Mixing halides in metal halide perovskites (MHPs) is an effective approach for adjusting the MHPs bandgap for applications in tandem solar cells. However, mixed-halide (MH-) MHPs undergo light-induced phase segregation (LIPS) under continuous illumination. Therefore, understanding the mechanism of LIPS is necessary for developing stable MH-MHPs. In this work, we investigated LIPS in layered (L) MHPs and discovered a critical role of spacer cations in LIPS. Through probing chemical changes of LIPS, we unveil light-induced iodide repulsion and the formation of Br-rich-phase in illuminated regions during LIPS. This discovery also gives insight into the LIPS process in three-dimensional (3D) MHPs. By further investigating LIPS in 3D MHPs, we reveal that LIPS induces not only the formation of Br-rich and I-rich domains but also an overall change of halide distribution along the film thickness direction. Moreover, LIPS is more significant in bulk due to a larger population of photogenerated charge carriers. Overall, this study reveals the chemical mechanism of LIPS in MHPs and its potential effect on device performance, offering insight into understanding the LIPS mechanism and improving the stability of MHPs.