Atoms become chemically stable by losing, gaining or sharing electrons with other atoms to fill up their outermost electron shell. This allows them to obtain the electron configuration of the nearest noble gas.
Noble gases, with the exception of helium, have a stable octet structure in their electron configuration. Helium has only one electron shell that is filled with two electrons. The rest of the noble gases have eight electrons in their outermost shell. All of the noble gases are chemically inert and are therefore considered to be chemically stable. Other atoms strive to achieve the stable octet structure by forming ionic or covalent bonds to facilitate losing, gaining or sharing of electrons.
Metals can achieve the octet structure by losing one to three electrons from their outermost shell to reveal the octet structure in the shell below. Non-metals need to gain electrons in order to complete their octet structure. Metals can donate their electrons to non-metals to form an ionic bond between the atoms. All atoms involved in an ionic bond are either positively or negatively charged and have a complete octet structure, which makes them chemically stable.
Non-metals can bond with each other through covalent bonds, formed by sharing electrons. For example, chlorine atoms in their neutral state are one electron short of the stable octet. Two chlorine atoms can share one electron each and complete each other’s octet by forming a covalent bond, thus becoming chemically stable. Atoms in a covalent bond remain neutral since the electrons are not lost or gained but are instead shared.