Charged groups of atoms are ions. Ions consist of one or more atoms that have gained or lost electrons. If the group gains electrons, it has a negative charge, and if it loses electrons, it becomes positive.
Ions join with other ions of the opposite charge in order to share electrons and form a neutral compound. Na+ joins with Cl- to form sodium chloride, which is common table salt. Oxygen with a -2 charge combines with two H+ ions to form water. Some ion groups remain together as a single ion that join with ions of the opposite charge to form a neutral compound. The sulfate ion, which has a -2 charge, joins with two positively charged potassium ions to creat potassium sulfate.