Final answer:
The number of valence electrons in an atom determines if it will form ionic bonds by transferring electrons or form covalent bonds by sharing electrons.
Step-by-step explanation:
The number of valence electrons an atom has determines whether its electrons will be transferred to form ionic bonds or shared to form covalent bonds.
Atoms gain or lose electrons to form ions with particularly stable electron configurations. Typically, metals will lose valence electrons to form positively charged ions or cations, while nonmetals will gain electrons to complete their valence shells, forming negatively charged ions or anions. This process illustrates ionic bonding, where the transfer of electrons results in the creation of opposite charges that hold the ions together.
The sharing of valence electrons between atoms represents a different type of chemical bond known as a covalent bond. Such bonds can be either nonpolar, where electrons are shared equally between atoms, or polar, where electrons are shared unequally due to differences in electronegativity. Compounds formed exclusively by covalent bonds are termed molecular compounds.