In order to conduct electricity, a substance needs to have charges that are free-moving. Electrons are negatively-charged subatomic particles of an atom. Metals, such as iron, have metallic bonds. In a metallic bond, the electrons are free to move around more than one atom. This is called delocalization. Because the electrons involved in the metallic bond of iron are free-moving, iron is a good conductor.
When in their liquid or gas states, the electrons of ionic compounds are also able to move freely. In such states, ionic compounds are able to conduct an electrical current.
Ionic compounds are made of positive and negative ions. Ions are charged atoms. Ions are formed to fulfill what is called the octet rule. The octet rule states that, in order to feel stable, all main-group elements want to have eight valence electrons. Valence electrons are the electrons found in the outermost orbital of an atom.
Cations are positively charged ions that have lost electrons. Elements that form cations lose their valance electrons in order to fulfill the octet rule. In this way, they drop to the next lower orbital that is full.
Anions are negatively charged ions. Anions are negatively charged because they have gained additional electrons in order to fulfill the octet rule.