Polarity arises only when identical atoms are joined by the bond.
The polarity of a bond arises from the relative electronegativities of the atoms present in the bond. Electronegativity is the power of an atom of an element to attract electrons toward itself when it is part of a compound's bond. Thus, although a bond in a compound may consist of a shared pair of electrons, the atom of the more electronegative element will draw the shared pair toward itself thereby acquire a partial negative charge that induces a polarity in the molecule.
Bonds between identical atoms (as in F2) are electrically uniform in the sense that both fluorine atoms have one electron each makes the bond electrically neutral(same amount of charge in either side which results in zero net charge), while the bonds between atoms of different elements are electrically inequivalent due to the difference in the magnitude of charge for different elements.