In some cases, two atoms are so unequal in their attraction for valence electrons that the more electronegative atom strips an electron completely away from its partner. The two resulting oppositely charged atoms (or molecules) are called ions. A positively charged ion is called a cation, while a negatively charged ion is called an anion. Because of their opposite charges, cations and anions attract each other; this attraction is called an ionic bond. Note that the transfer of an electron is not, by itself, the formation of a bond; rather, it allows a bond to form because it results in two ions of opposite charge. Any two ions of opposite charge can form an ionic bond. The ions do not need to have acquired their charge by an electron transfer with each other.
This is what happens when an atom of sodium (11Na) encounters an atom of chlorine (17Cl). A sodium atom has a total of 11 electrons, with its single valence electron in the third electron shell. A chlorine atom has a total of 17 electrons, with 7 electrons in its valence shell. When these two atoms meet, the lone valence electron of sodium is transferred to the chlorine atom, and both atoms end up with their valence shells complete. (Because sodium no longer has an electron in the third shell, the second shell is now the valence shell.) The electron transfer between the two atoms moves one unit of negative charge from sodium to chlorine. Sodium, now with 11 protons but only 10 electrons, has a net electrical charge of 1+; the sodium atom has become a cation. Conversely, the chlorine atom, having gained an extra electron, now has 17 protons and 18 electrons, giving it a net electrical charge of 1-; it has become a chloride ion—an anion.
Compounds formed by ionic bonds are called ionic compounds, or salts. We know the ionic compound sodium chloride (NaCl) as table salt. Salts are often found in nature as crystals of various sizes and shapes. Each salt crystal is an aggregate of vast numbers of cations and anions bonded by their electrical attraction and arranged in a three-dimensional lattice. Unlike a covalent compound, which consists of molecules having a definite size and number of atoms, an ionic compound does not consist of molecules. The formula for an ionic compound, such as NaCl, indicates only the ratio of elements in a crystal of the salt. “NaCl” by itself is not a molecule.
Not all salts have equal numbers of cations and anions. For example, the ionic compound magnesium chloride (MgCl2) has two chloride ions for each magnesium ion. Magnesium (12Mg) must lose 2 outer electrons if the atom is to have a complete valence shell, so it has a tendency to become a cation with a net charge of 2+ (Mg2+). One magnesium cation can therefore form ionic bonds with two chloride anions (Cl-).
The term ion also applies to entire molecules that are electrically charged. In the salt ammonium chloride (NH4Cl), for instance, the anion is a single chloride ion (Cl-), but the cation is ammonium (NH4+), a nitrogen atom covalently bonded to four hydrogen atoms. The whole ammonium ion has an electrical charge of 1+ because it has given up 1 electron and thus is 1 electron short.
Environment affects the strength of ionic bonds. In a dry salt crystal, the bonds are so strong that it takes a hammer and chisel to break enough of them to crack the crystal in two. If the same salt crystal is dissolved in water, however, the ionic bonds are much weaker because each ion is partially shielded by its interactions with water molecules. Most drugs are manufactured as salts because they are quite stable when dry but can dissociate (come apart) easily in water.
Urry, Lisa A.. Campbell Biology. Pearson Education. Kindle Edition. https://www.pearson.com/us/higher-education/series/Campbell-Biology-Series/2244849.html