Covalent compounds are formed by the sharing of electrons between atoms, typically non-metals or metalloids. Ionic compounds are formed by the transfer of electrons between a metal and a non- metal, resulting in the formation of ions held together by electrostatic attraction.