This results from electronegativity and causes polarity.
Different atoms have different values for electronegativity. Electronegativity is really a measure of how strongly an atom will pull/attract electrons to itself when it's participating in a covalent bond.
If an atom with a higher electronegativity combines with an atom with a lower electronegativity covalently, then the following will occur. (Focus on the shape of the molecule to the bottom left)
Let's use HCl as an example. Cl is more electronegative than H. This means that Cl will pull the shared electrons to itself more strongly than H will. This causes the electrons to be shared unevenly in the covalent bond.
Look at this image.
Recall that eletrons are negatively charged particles. If Cl is pulling them more strongly, then they will be closer to that end of the molecule. Hence, Cl will obtain a slight
This is polarity. Both atoms in the molecule have become slightly charged due to the uneven sharing of electrons within the covalent bond.