The atom or ion will only lose electrons if it receives enough energy, which is the ionization energy.
In practice, the most important thing is first ionization potential or first ionization energy, which corresponds to the removal of the first electron. It is usually the lowest ionization energy, as this electron is the farthest from the nucleus, the its attraction force with the core is the lowest, requiring less energy and being easier remove it.
Furthermore, with the loss of electrons, the atomic radius decreases and the ion becomes more and more positive, hence the attraction with the nucleus gets stronger and consequently more energy will be needed to pull out the next electron and so successively.
To consider an example, the sodium atom has as its first ionization energy the value of 406 kJ/mol. Its second ionization energy is 4560, that is, much higher than the first. This shows that it takes a lot more energy for sodium to pull out two electrons than just one. This is why in nature it is more common to find sodium atoms with a +1 charge.
Note how this happens in the case of aluminum below:
13Al+ 577.4 kJ/mol → 13Al1++ and-
13Al+ 1816.6 kJ/mol → 13Al2++ and-
13Al+ 2744.6 kJ/mol → 13Al3++ and-
13Al+ 11575.0 kJ/mol → 13Al4++ and-
Thus, for Aluminum we have the following order of ionization energy (EI):
1st EI < 2nd EI < 3rd EI <<< 4th EI
From this fact, we can conclude that:
Therefore, if we consider the elements in the same family or in the same period of the periodic table, we will see that as the atomic numbers increase, the lower the ionization energies, because the further away from the nucleus the electrons they are. In this way, the ionization energy grows in the periodic table from bottom to top and from left to right. Therefore, ionization energy is a periodic property.
See how this is shown below and compare the values of the first ionization energy of some atoms, which were obtained experimentally in kJ (kilojoule):
Notice how the values of the ionization energies of the elements from the second period of the Periodic Table are greater than those from the third period, and so on. Also pay attention to the fact that the first ionization energies of the elements of the 1A family are lower than those of the 2A, and so on.
Those representative elements that have low ionization energy lose electrons to become stable, that is, to have the noble gas configuration. Those with high ionization energy (ametals) receive electrons instead of losing them.
By Jennifer Fogaça
Graduated in Chemistry
Source: Brazil School - https://brasilescola.uol.com.br/quimica/energia-ionizacao.htm