Ionic compounds form when a metal transfers electrons to a nonmetal, resulting in oppositely charged ions that are attracted in a crystal lattice structure. The ratio of cations to anions must result in an overall neutral charge. Ionic compounds are named by writing the cation first followed by the anion. Polyatomic ions are named based on the nonmetal and number of oxygen atoms. Metallic bonds form a "sea of electrons" that are delocalized and allow metal atoms to strongly attract each other.