the potential difference across a battery with a negligible internal resistance is equal in magnitude to the emf
as a charge passes from the baterry the non electric forces do work qE on it .
if q is +ve the +ve work
the electric forces on the other hand do an equal amount of negative work and the electrostatic system gains electric potential energy.