Engineering a reaction pathway to harmonize the competition between nitrogen reduction reaction (NRR) and hydrogen evolution reaction (HER) is an active strategy toward efficient ammonia synthesis. Herein, we insert a "hydrogen state switching" reaction between the NRR and HER in ammonia synthesis. H 2 from HER in NH 2 -MIL125 core is captured by the Ni nanoparticles on polydopamine shell and switched into adsorbedstate *H species, which are then transferred back to NH 2 -MIL125 core via NiO to react with nitrogen and produce NH 3 . By manipulating the reaction pathway of hydrogen generation-state switching-transfer-utilization, HER can supply the required hydrogen for NRR. Accordingly, our photocatalyst achieved the NH 3 yield and selectivity of 817 μmol g −1 h −1 and 99.8% in NRR, respectively, superior to those of most state-of-the-art photocatalysts. Our strategy, as "transforming-competition-into-cooperation" strategy, is applicable for many complex reaction systems.