Call

A completely filled outer electron shell is stable because it can not gain any more electrons, it is full. Being completely full it has no desire to lose electrons thereby losing its stable structure.

Neon for example has 10 electrons. Its is
$ 1s^2 2s^2 2p^6$
The $ 1s^2$ is the structure of Helium a completely filled first electron shell. These two electrons are very stable.

$2^2p^6$ is a completely fill second electron shell. This is a very stable electron configuration.

Oxygen starts with an electron configuration of
$1s^2 2s^2 2p^4$

This is two electrons short of the stable structure of Neon. By gaining two electrons Oxygen can achieve this stable structure so
$O^-2 = 1s^2 2s^2 2p^6$

Sodium starts with an electron configuration of
$1s^2 2s^2 2p^6 3s^1$

This is one more electron than the stable structure of Neon. By losing one electron Sodium can achieve Neon stable structure so
$ Na^+1 = 1s^2 2s^2 2p^6$

Elements electron configurations are all about achieving stability.
The most stable electron configurations are those of the noble gases.