The O 1s electron experiences a greater Coulombic force due to the greater nuclear charge and thus has a higher binding energy. However, while simplistic arguments like this are useful in predicting relationships between core-level binding energies, the measured binding energy of an electron is, as we'll see, related not only to the magnitude of the electron-nucleus interaction but also is strongly dependent on electron-electron interactions (which in turn mediate the electron-nucleus interaction).