Flexi Says: Atoms form ions by losing or gaining electrons because it makes them more stable and this state takes less energy to maintain. The most stable state for an atom is to have its outermost energy level filled with the maximum possible number of electrons. In the case of metals such as lithium, with just one electron in the outermost energy level, a more stable state can be achieved by losing that one outer electron. In the case of nonmetals such as fluorine, which has seven electrons in the outermost energy level, a more stable state can be achieved by gaining one electron and filling up the outer energy level. In the case of group 13 elements such as aluminium, the loss of three outermost electrons will form an Al3+ ion that now has a completely filled outermost shell with 8 electrons.