Atoms form chemical bonds because bonding makes them more stable. Most atoms are more stable when their outer electron arrangement resembles that of a noble gas (the far-right column of the periodic table), which typically means having a full set of outer electrons. Atoms achieve this by transferring electrons to other atoms, sharing electrons with other atoms, or a combination of both. The drive toward a more stable electron arrangement is the fundamental reason chemical bonds exist.
Start by looking at noble gases and asking why they almost never react. Then compare them to reactive elements like sodium or chlorine and notice what is different about their electron counts. The idea that atoms bond to reach a more stable arrangement becomes intuitive when you see the pattern.
You already know that atoms have protons and neutrons in the nucleus, with electrons surrounding it. But why do atoms stick together to form molecules and compounds in the first place? The answer lies in the behavior of electrons, particularly the ones in the outermost region of the atom.
Look at the far-right column of the periodic table: the noble gases — helium, neon, argon, krypton, xenon, and radon. These elements almost never react with anything. They do not form compounds under normal conditions. The reason is that their outermost electrons are arranged in a completely filled, very stable configuration. Think of it like a completed puzzle — there is no gap to fill and no extra piece to get rid of, so there is no drive to change.
Most other elements are not so lucky. Their outermost electrons are in an incomplete arrangement — like a puzzle with missing pieces. This makes them less stable and gives them a tendency to interact with other atoms to reach a more stable state. Chemical bonding is the process by which atoms achieve that stability. There are two main strategies atoms use.
The first strategy is transferring electrons. An atom with just one or two outer electrons can give them away to an atom that needs one or two to complete its arrangement. This is what happens between metals (which tend to lose electrons) and nonmetals (which tend to gain them). The result is an ionic bond, held together by the attraction between the positively charged atom that lost electrons and the negatively charged atom that gained them. Sodium chloride (table salt) forms this way: sodium gives one electron to chlorine, and both end up with stable arrangements.
The second strategy is sharing electrons. Two nonmetal atoms that both need electrons can pool their resources, with each atom contributing electrons to a shared pair. This creates a covalent bond. Water forms this way: each hydrogen atom shares one electron with the oxygen atom, and the oxygen shares one electron with each hydrogen. All three atoms end up with more stable electron arrangements than they started with.
The key insight is that bonding is driven by stability. Bonded atoms are in a lower-energy state than isolated atoms — similar to how a ball rolling downhill settles into the lowest point. Atoms do not choose to bond; they end up bonded because the bonded arrangement is the most energetically favorable outcome.