An electric potential difference is created when two charges are separated. In a capacitor, there is a clear accumulation of opposite charges on the two separated plates, therefore work has to be done in moving an unit charge from one plate to another, against the electric field.
But, according to this answer , a potential difference is created in a resistor due to the heat produced by the collision and increased lattice vibrations. So there is an energy loss across the resistor, yes, but how does this energy loss due to heat create an electric potential difference. In other words, do electrons accumulate on one sideor both sides of the resistor? If not, why should we do electric work in moving from one end of the resistor to another. If the difference in energy is not due to electric work, then that's not electric potential, is it?