**Problem.** I've come up with the strange example of the *third* energy of ionization of both $\pu{Mg}$ and $\pu{Al}$, the standard logic that is to be applied on any problem of "which element has more energy of ionization", should be guided by how that element it's located on the periodic table, that way we can find it's periodic characteristics, like nuclear charge, and all of them.

**My issue.** The intuitive way to think about it, is that since $\pu{Al}$ is more to the right than $\pu{Mg}$ in the periodic table, it should be enough to prove that with all the periodic characteristics, Al has more energy of ionization than Mg. But what happens is all the way around actually, same thing happens with the first energy of ionization, which made me very confused.

**What I tried to think to resolve this whole mess**. I then thought that it has to happen due to another factor, and then I looked at the electronic configuration: $$\pu{Mg:[Ne]} \ 3s^2$$ $$\pu{Al:[Ne]} \ 3s^2\ 3p^1$$ and took a look at the ions $\pu{Mg+3 and Al+3}$, since I *think that's where I have to look if we are investigating the 3rd energy of ionization, if this is wrong, please do let me know:* $$\pu{Mg+3:[He]}\ 2s^2\ 2p^5$$ $$\pu{Al+3:[Ne]} $$ so then I thought that in these last ions, $\pu{Mg+3 is quite more inestable than Al+3, since Mg+3 has lost one full orbital while Al+3 has it full}$. And then that would kind of make sense intuitively? Since if one ion is more stable, it would be harder to take away one electron from it, hence the energy of ionization would be higher from the stable one, right?

*Is this logic correct or is it flawed?* **And**, *if it's flawed, then how is it that Al has more energy of ionization than Mg? What should my general strategy to find which element has more energy of ionization be? Since just looking at the orientation on the periodic table doesn't seem to work always, like in this one.*