I understand that copper has the electronic configuration $\ce{[Ar] 4s^1 3d^10}$ because a fully filled $\ce{4d}$ orbital provide a more stable configuration.
But I don't understand why the two copper ions have the following electronic configurations: $\ce{4s^0 3d^10}$ and $\ce{4s^0 3d^9}$.
Specifically, why is the electron from the $\ce{4s}$ subshell is removed before the electron from the $\ce{3d}$ subshell?
It does have a higher value of $n$ placing it farther than the latter, but it also has lower energy. And how does the extra stability provided due to the fully filled orbital accounted for?
My knowledge of chemistry is very basic at this point, so I would appreciate if any mistakes in the logic of my question or otherwise were brought to my attention.