Elucidating the battery operating mechanism is important for designing better conversion-type anodes as it determines the strategies used to improve electrochemical performances. Herein, the authors pioneered the electrochemical study of layered Bi2O2Se as anodes for lithium-ion batteries (LIBs) and potassium-ion batteries (PIBs). Surprisingly, the Bi2O2Se/graphite composite electrode shows even better cycle stability for PIBs. The electrochemical reaction mechanisms of the Bi2O2Se/graphite electrode for LIBs and PIBs are investigated by potential-resolved in situ and ex situ X-ray absorption spectroscopy based at the Bi LIII-edge and Se K-edge through characterizing the local atomic structure evolution, valence state change, and charge transfer. New insights are gained regarding the electrochemical process of Se2− anions in Bi2O2Se, where multiple Li–Se intermediates rather than the traditional single-phase Li2Se are involved in this conversion-type anode. The advanced understanding of anionic electrochemistry in conversion-type anodes prompts one to find appropriate ways to suppress side-reactions and improve the battery performances.