In ionic bonding, atoms transfer electrons to achieve a complete outer electron shell. This transfer leads to the formation of positively charged ions (cations) and negatively charged ions (anions). Oppositely charged ions are attracted to each other, forming an ionic bond. As an example, sodium (Na) can lose an electron to form a Na⁺ cation. In covalent bonding, atoms share electrons to fill their outer electron shells. This process creates a stable electron configuration for both atoms involved. For example, in a water molecule, oxygen and hydrogen atoms share electrons to achieve a complete outer shell.