when a metal and a non-metal react the metal atom loses electrons to form a positively charged ions and the non-metal gains these electrons to form a negatively charged ions
these oppositely charged ions are strongly attracted to one another by electrostatic forces - this is called ionic bonding