What is the origin of the differences between the MO schemes of O₂ and N₂?
This phenomenon is explained by s-p mixing. All the elements in the second period before oxygen have the difference in energy between the 2s and 2p orbital small enough, so that s-p mixing (combination) can occur lowering the energy of the σ(2s) and σ*(2s) and increasing the energy of the σ(2p) and σ*(2p) molecular orbitals. By moving towards right in a period, the s orbital gets more stabilized than the p orbital and the difference in their energies increases, making the s-p mixing for oxygen much smaller.