In an atom, the negatively charged electrons are attracted to the positively charged nucleus. In a multielectron atom, electron-electron repulsions are also observed. The attractive and repulsive forces are dependent on the distance between the particles, as well as the sign and magnitude of the charges on the individual particles. When the charges on the particles are opposite, they attract each other. If both particles have the same charge, they repel each other.
As the magnitude of the charges increases, the magnitude of force increases. However, when the separation of charges is more, the forces decrease. Thus, the force of attraction between an electron and its nucleus is directly proportional to the distance between them. If the electron is closer to the nucleus, it is bound more tightly to the nucleus; therefore, the electrons in the different shells (at different distances) have different energies.
For atoms with multiple energy levels, the inner electrons partially shield the outer electrons from the pull of the nucleus, due to electron-electron repulsions. Core electrons shield electrons in outer shells, while electrons in the same valence shell do not block the nuclear attraction experienced by each other as efficiently. This can be explained with the concept of effective nuclear charge, Zeff. This is the pull exerted on a specific electron by the nucleus, taking into account any electron-electron repulsions. For hydrogen, there is only one electron, and so the nuclear charge (Z) and the effective nuclear charge (Zeff) are equal. For all other atoms, the inner electrons partially shield the outer electrons from the pull of the nucleus, and thus:
Orbital penetration describes the ability of an electron to be closer to the nucleus. The electrons in the s-orbital can get closer to the nucleus and have a more penetrating ability. The probability density for a spherical s-orbital is non-zero at the nucleus. Different subshells have different spatial orientations. Due to the dumbbell-shaped orbital, the p-electron penetrates much less. Its wavefunction has a node passing through the nucleus, where the probability of finding the electron is zero. Thus, an s orbital electron is bound more tightly to the nucleus and has lower energy than the p-electron. A d-electron has even lower penetration and higher energy than a p orbital electron.
For various shells and subshells, the trend of penetrating power of an electron can be depicted as follows
The effect of shielding and penetration is large, and a 4s electron may have lower energy than a 3d electron.
This text is adapted from Openstax, Chemistry 2e, Section 6.4: Electronic Structure of Atoms (Electron Configurations).