Final answer:
Atoms gain stability by fulfilling the octet rule; oxygen and hydrogen share electrons in water for a full valance shell. Sodium donates its single valence electron to chlorine, resulting in a sodium ion (Na+) and a chloride ion (Cl-).
Step-by-step explanation:
The stability of atoms in molecules is explained by the octet rule, which ensures that atoms are most stable when their valence shell contains eight electrons. In the formation of a water molecule, oxygen atom, with six electrons in its valence shell, shares two pairs of electrons with two hydrogen atoms that each share their single electron. By doing this, all participating atoms fulfill the octet rule, achieving a full outer energy level and hence stability.
Sodium has one electron in its valence shell, while chlorine has seven. When sodium and chlorine bond to form sodium chloride, sodium donates its one electron to chlorine. As a result, sodium bears a positive charge, becoming a sodium ion (Na+), and chlorine gains an extra electron, becoming a negatively charged chloride ion (Cl-).