Ionic compounds are formed when atoms transfer electrons from one to another, creating charged particles called ions. Typically, this occurs between metals and nonmetals. For example, when sodium (Na) reacts with chlorine (Cl), sodium loses an electron to become a positively charged ion, while chlorine gains that electron to become a negatively charged ion. These oppositely charged ions attract each other, forming a strong bond.
These compounds usually have high melting and boiling points, making them solid at room temperature. They also conduct electricity when dissolved in water or melted, as the ions are free to move. Common examples of ionic compounds include table salt (NaCl) and magnesium oxide (MgO).