The atoms involved in ionic bonding are held together by an electrostatic force of attraction between a positive and a negative ion. Ionic bonds are only formed between metals and non-metals.
Ionic bonding occurs in the presence of a positive and a negative ion. Ions are formed when neutral atoms either lose or gain an electron. All atoms either lose or gain electrons to achieve a stable electron configuration. The most stable, noble gases, all have eight electrons in their outermost shells, with the exception of helium, which has only two electrons. When an atom has eight electrons in its outer shell, it is said to have a stable octet structure.
Metals have one to three electrons in their outer shells, which prevents them from forming a stable octet structure. It is easier for the atoms to lose electrons to reveal an underlying shell with eight electrons, rather than gaining electrons to complete the octet structure. Therefore, metals form positive ions. Non-metals, however, tend to gain one or more electrons to complete the octet in their outermost shell, and therefore tend to form negative ions.
Metals can donate their electrons to non-metals. Since the charges on the ions are unlike (oppositely charged ions), the positively charged metal atom is held to the negatively charged non-metal atom with a strong electrostatic force of attraction.