MgCl is an ionic compound that is formed between two ions Mg⁺ and Cl⁻. An ionic bond is formed between two elements when there is an even gaining or losing of electrons in order for them both to be stable. The Mg⁺ during the process of bonding donates or loses 1 electron which is accepted by the Cl⁻.