"Electronegativity is the power of an atom to attract the electron density in a covalent bond to itself"
In order to understand electronegativity we must understand that electrons orbit the nucleus and the region the electron orbits is known as a charge cloud- also referred to as the electron density. The nucleus of the atom contains protons and neutrons so it is overall positively charged and therefore has the ability to attract the negative electron density towards itself.
The factors affecting electronegativity are: nuclear charge, distance between the nucleus and outer shell, and the shielding by electrons in inner shells. As the nuclear charge increases, the positive charge increases so electrons are drawn towards the positive nucleus more. As the electrons are further away from the positive nucleus their 'pull' towards it is less so the electronegativity is lower. Finally, as there are more inner shells between the outer electron and the nucleus, the positive attraction is dissipated so there is less force attracting the electron resulting in a lower electronegativity. In a covalent bond, atoms with different electronegativity attract the electron density with varying strength resulting in polar bonds.