Electromotive force(emf) or $\mathcal{E}$ is defined as $$\mathcal{E} = \oint \frac{\vec{F}}{q} \cdot \mathrm{d}\vec{s}$$ Here, $\vec{F}$ is the force which pushes the charges through a conducting wire loop, $q$ is the magnitude of charge and $\vec{s}$ is the displacement of the charge. $\mathcal{E}$ is the tangential force per unit charge in the wire integrated over length, once around a complete circuit.
Now in my Physics book, it is written that an emf must be nonelectrostatic in origin. Only then, it can force the charges to move in a loop. Conservative electric fields cannot make the charges move in loops. Now, if we connect a battery and a resistor with wires in a loop, a current is established. This means that a battery has some nonelectrostatic forces which can separate the positive and negative charges or otherwise $\mathcal{E}$ will become $0$ when integrated over the whole circuit.
What is is this nonelectrostatic force which is responsible for driving the electrons? If its chemical, due to the electronegativity differences, how is it nonelectrostatic? Electronegativity occurs due the electrostatic attraction of the electrons and the nucleus plus some shielding, doesn't it?