Here's why:
* Carbon has four valence electrons: These are the electrons in the outermost shell that participate in bonding.
* Carbon wants to have eight electrons in its outer shell: This is the octet rule. To achieve this, carbon needs to share four electrons.
* Each bond involves two shared electrons: This means carbon can form four bonds to achieve a stable octet.
These four bonds can be with other carbon atoms, or with hydrogen atoms, forming the basis of all hydrocarbon molecules.