* Electronegativity Difference: Magnesium has an electronegativity of 1.31, while sulfur has an electronegativity of 2.58. The difference in electronegativity is 1.27, which is considered quite large. This means that sulfur has a much stronger attraction for electrons than magnesium.
* Electron Transfer: Due to the significant electronegativity difference, magnesium will transfer two electrons to sulfur. This forms a magnesium ion (Mg²⁺) with a positive charge and a sulfide ion (S²⁻) with a negative charge.
* Electrostatic Attraction: The oppositely charged ions are then attracted to each other through electrostatic forces, forming an ionic bond.
Therefore, the compound formed by magnesium and sulfur, magnesium sulfide (MgS), is an ionic compound.