What is reason of stability of metal (Sr and Ba) peroxides?

While studying inorganic chemistry I came across the following chemical equation.


$$\ce{M + Air\left(1/2O2 + N2\right) ->[Δ] MO ->[\text{Excess}~O2] MO2 (Stable) + M3N2}$$


$$\ce{M} = \ce{Sr, Ba}$$


My question is why peroxides are more stable than oxides here but in case of other alkali earth elements $(\ce{M} = \ce{Be, Mg, Ca})$ oxides are more stable.


These are the things that came into my mind:


The structure of $\ce{SrO2}$, $\ce{BaO2}$ are isomorphous to $\ce{CaC2}$. I don't think this is causing any extra stability.


The increased basic nature of oxides maybe de-stabilizing oxides when going down the group.


Or maybe the large size of $\ce{Sr^2+}$, $\ce{Br^2+}$ better fits with $\ce{O2^2-}$ in crystal lattice than $\ce{O^2-}$ which leads to increase in lattice energy of peroxides.


I am still a very beginner to inorganic chemistry so it should be helpful if someone explains in a bit more detail.


