The ability of an atom to attract or donate electrons is determined by its electronegativity, which is a measure of the relative attraction an atom exerts on electrons in a chemical bond. The more electronegative an atom is, the more strongly it attracts electrons.
When two atoms with different electronegativities come into contact, the more electronegative atom can pull electrons away from the less electronegative atom. This results in the formation of an ionic bond, where one atom becomes positively charged (cation) and the other atom becomes negatively charged (anion).
For example, when sodium (Na) and chlorine (Cl) atoms react, the chlorine atom, which is more electronegative, pulls an electron away from the sodium atom. This results in the formation of sodium chloride (NaCl), where sodium becomes a positively charged cation (Na+) and chlorine becomes a negatively charged anion (Cl-).
Electron transfer is a fundamental process in chemistry, and it plays a vital role in many chemical reactions and phenomena, including the formation of chemical bonds, the reactivity of substances, and the flow of electricity.