Explain electronegativity? and how it can justify why a metal will lose electrons and a nonmetal will gain electrons.

$\text{Electronegativity}$ is conceived to be the ability of an atom involved in a chemical bond, to polarize electron density towards itself.