The electron sharing between atoms are not always necessarily shared equally.
Therefore, we have what we call bond polarity:
We can say that:
- A nonpolar covalent bond is one in which the electrons are shared equally between two atoms
- A polar covalent bond is one in which one atom has a greater attraction for the electrons than the other atom. If this relative attraction is great enough, then the bond is an ionic bond
Therefore we can say that bond polarity depends on the electronegativity of the atoms. If you have the most electronegative ATOM namely, Fluorine, and you have another atom like hydrogen, the bond polarity would be facing towards fluorine.
However, when you have two hydrogen atoms facing towards oxygen (cannot use fluorine, but oxygen is at least almost as electronegative), you have two hydrogen’s whose polarity go towards oxygen and then converge against each other because they are one opposite ends. This accounts for nonpolar covalent bonds.
On the other hand, when you have an atom which has a higher electronegativity than the other, when they converge against each other, the one with the higher electronegativity will form a polar covalent bond (i think).
An analogy would be: there are two cars tied together, both go in opposite directions, the car on the left and right share the same model, and horsepower, therefore both of them stay stagnant. But if you have the car on the left being a toyota corolla and the right being a mitsubishi lancer (sorry, old school). The mitsubishi lancer has a higher horsepower therefore he will pull the toyota corolla with him.