When a covalent compound is formed, the electrons of each atom spend a portion of their time in the orbit of the other atom. Electrons are shared in a covalent bond, with either two, four or six electrons involved at any one time, depending on the degree of the bond. This stands in contrast to ionic compound formation, where electrons are stolen by one atom from another.
In covalent bonds, the electrons of each atom spend a portion of their time with the other bonded atom, but this sharing is not always equal. Indeed, truly equal sharing only occurs when a molecule, such as the ones that compose nitrogen or oxygen gas, is made of two or more of the same element. Any other element has at least a slight difference in electronegativity, the ability of an element to attract and bind electrons.
Thus, when two different elements form a covalent bond, their shared electrons are shared unequally, with the more electronegative element gaining a greater share. The electrons of both atoms in the bond spend more time with the more electronegative atom. This results in a polar bond, where one side has a greater negative charge and the other a more positive charge.