Different atoms supply different numbers of electrons in their outer shells, one per proton in the nucleus. Thus as we progress through the periodic table, Hydrogen has one proton and one electron, Helium two of each, etc. Each atom's 'desires' in life correspond to the the number of electrons it needs to acquire to fill its outer shell. Or it can go the other way, giving up its only electron and becoming a wandering proton. Nitrogen has 5 outer electrons, so it has one pair and seeks 3 to complete its 'hand'.
Some nuclei are greedier than others.
The lust for electrons is given the technical term 'electronegativity'. If two partners in bondage have similar electronegativities, then shared electrons are truly shared, with neither partner monopolizing the pair. Contrariwise, unequal sharing has several interesting consequences. The resulting partially charged atoms seek extramarital charged atom pairs up with a partially positively charged hydrogen atom, the resulting pairing is called a hydrogen bond. The final important type of bondage is the so-called 'hydrophobic interaction'.