Electronegativity values are useful in predicting how electrons will be shared. Electronegativity is a measure of the attraction an atom involved in a covalent bond has for the electrons of the bond. In hydrogen iodide, HI, the iodine atom is more electronegative than the hydrogen so the iodine has the greater attraction for the shared electrons.
This means the shared pair are attracted nearer to iodine, which as a result becomes slightly negatively charged, δ. The hydrogen becomes slightly positive, δ+ because the shared electrons have moved nearer the iodine. When the sharing of the bonding electrons is unequal we call it a polar covalent bond.
In hydrogen fluoride, HF, the difference in electronegativities is greater so this covalent bond is more polar. In some compounds, one atom is so much more electronegative than the other that there is no sharing of electrons at all. E.g. in Lithium fluoride the electronegativities are 1.0Li and F4.0. This difference is so great that the bonding electron originally belonging to lithium is transferred to the fluorine. This forms two ions of opposite charge, Li+ and F.
These are attracted to each other. This electrostatic attraction is called the ionic bond. Don’t think of non-polar covalent, polar covalent and ionic as three completely separate types of bonding. Rather think of them as being on a continuous scale. At one end is non-polar covalent with its equal sharing of electrons, moving on to progressively more and more polar covalent. Eventually, the sharing is so unequal that an electron is effectively transferred from one atom to the other forming ions, and therefore ionic bonding.