The electrostatic force that holds oppositely charged particles together in this type of compound. The metal ion transfers electrons to an atom lacking a full valence shell, giving the atoms positive and negative charges. These oppositely charged cations and anions then attract, forming an ion.