Answer:
To gain stability
Explanation:
If the outermost shell is not completely filled with electrons, the element has one of the three options: gaining electrons, losing electrons or sharing electrons. By gaining or losing electrons, ionic compounds are produced. Sharing of electrons results in the formation of covalent compounds.