In the NCERT textbook grade 12, it is mentioned before deriving the work done in moving a charge $q$ from point $R$ to $P$ in presence of an electric field at Origin, $O$ by charge $Q$
Two remarks may be made here. First, we assume that the test charge q is so small that it does not disturb the original configuration, namely the charge Q at the origin (or else, we keep Q fixed at the origin by some unspecified force).
This makes sense for obvious reasons
Second, in bringing the charge q from $R$ to $P$, we apply an external force $F_{ext}$ just enough to counter the repulsive electric force $F_{ele.}$ (i.e, $F_{ext}$= –$F_{electric}$. This means there is no net force on or acceleration of the charge q when it is brought from $R$ to $P$, i.e., it is brought with infinitesimally slow constant speed. In this situation, work done by the external force is the negative of the work done by the electric force and gets fully stored in the form of the potential energy of the charge $q$.
I know how to derive the potential energy of a charge, but I can't understand why we have made this second assumption, that the externally applied force and the electrical forces have to be equal. Now coming to a thermodynamic derivation for work done in expanding/compressing volume keeping the pressure varying (i.e. in slow process)
here we use the same notion of $dW=F.ds$ which is converted to
$$dW= P_{ext}.dV$$
but this time we replaced $P_{ext}$ with $P_{int}+dP$. And so we get $$dW= (P_{int}+dP).dV$$
Why did we not add a similar $$F_{ext}=F_{electric}+dF$$
And so continue
$$dW= (F_{electric}+dF).ds$$
Note that both the cases mentioned are happening in infinitesimally slow speed if I am right, so why different treatment? The only possible explanation I can come up with is that one conservative force and another is not, but I couldn't build upon it.
TLDR;
Why is there additional Pressure, $dP$ added in the thermodynamic derivation but no additional $dF$ added for the electrostatic derivation?