Ions
Atoms are made of protons, which are positively charged; neutrons, which have no charge; and electrons, which are negatively charged. An element's atoms normally contain protons and electrons in equal numbers and so are electrically neutral. Sometimes, though, atoms can lose electrons or gain extra ones. An atom takes on an overall negative charge if it gains electrons and, conversely, becomes positive if it loses electrons. Groups made of several atoms joined together can also lose or gain electrons. An atom or group of atoms that has acquired either a positive or negative charge is an ion.
Electronegativity
Every atom has a nucleus containing positively charged protons and tends to attract negatively charged electrons. Chemists have developed a measure for the extent of this attraction and term it electronegativity. Different elements, due to variations in the size of their atoms and other factors, differ greatly in electronegativity. Elements towards the left of the periodic table, such as sodium, have lower values of electronegativity, and elements on the right side, fluorine for example, have higher values.
Forming Ions
Normally, atoms that are bonding contribute one electron each to the bond and these two electrons are shared. Two atoms with a large difference in electronegativity, however, bond differently. The more electronegative atom takes both electrons and ends up with an overall negative charge. The other atom of the pair loses its electron and becomes positive. The two atoms then stick to one another because there is a mutual attraction between their opposite charges.
Anions and Cations
Chemists refer to the more electronegative atoms or atomic groups that become negative ions as anions. An anion is a specific case of an ion; it is a negative ion. Positive ions are called cations. As an example, common table salt, or sodium chloride, is made of the sodium cation, Na+, and the chloride anion, Cl-. The oxidizer potassium nitrate, commonly used in fireworks, is made of the potassium cation, K+, and the nitrate anion, NO3-, so this is an example where the anion is a group of atoms rather than a single atom.