Suppose I have a large collection of microscopic charges, say $10^{30}$ or so, occupying some large 3d space. I want to find the work it takes to build this collection.
In an ideal world, one would use the formula $\frac{1}{2}\iiint \rho_{micro} \phi_{micro} d\tau$ (where $\rho_{micro}$ and $\phi_{micro}$ are the microscopic charge densitiy and potential respectively). This is the true work (within the framework of classical EnM)
The true work, the work calculated using microscopic quantities is near impossible to calculate in practice. So we are clear that we should use macroscopic quantities to get a good approximate picture of the work it takes.
Now, let's say I have done Lorentz averaging of all the microscopic quantities over a volume of 1000 molecules (or equivalently, a weighted averaging, using a weight function whose range is of the order of the linear dimension of the volume of these 1000 molecules, the details of this don't matter much)
Since I've done the averaging over this volume, one can say, approximately, quantities like $\rho_{macro}$ or $\phi_{macro}$ stay somewhat constant within these blobs of charge.
We also know (again, to a good approximation) that:
$$F_{blob}= Q_{blob} \vec E_{macro} $$ where $F_{blob}$ $Q_{blob}$ and $E_{macro}$ are the force experienced by the blob, charge contained in the blob and the averages out electric field(the macroscopic field) respectively. (This is the claim in Zangwill, page 40, 2012 edition, and I've also seen this in FNH Robinson's book).
So I can safely say, the macroscopic work it takes to bring a blob from infinity to it's prescribed point, in the presence of the rest of the blobs, is equal to $Q_{blob} \phi_{macro} $ if our reference is to be infinity. Hence, the macroscopic work it takes to build a system is:
$$ \frac{1}{2} \sum \rho_{macro} \Delta V \phi_{macro} $$ where $\Delta V$ is the volume of the blob.
Consider the integral: $$\frac{1}{2} \iiint_{all space} \rho_{macro} \phi_{macro} d\tau $$
I can rewrite this as $$\sum_{all blobs} \iiint_{each blob} \rho_{macro} \phi_{macro} d\tau $$
And since over each blob the potential, which has been smoothened out, stays somewhat constant, I can take it out of the integral and write: $$\sum_{all blobs} \phi_{macro} \iiint \rho_{macro} d\tau$$ which boils down to the previous summation i wrote. Hence, the integral representing the macroscopic work is correct.
THINGS TO KEEP IN MIND:
the macroscopic formula inherently does not contain the self energy terms of each of these blobs. One can only expect this from the microscopic formula.
Now consider this:
Case 1
I change the system from one to another, by just moving these blobs around. The self energies of these blobs are the same in both the configurations. In such a situation, the work done in reconfiguring the system would simply be:
$${\frac{1}{2} \iiint_{all space} \rho_{macro} \phi_{macro} d\tau }_{final state} - {\frac{1}{2} \iiint_{all space} \rho_{macro} \phi_{macro} d\tau}_{initial state} $$
Case 2
If i change my system at a fundamental level, as in, the microscopic structure has changed now. Here, the macroscopic formula would not give us the correct redistribution energy, as the self energies of each of the blobs are different, since the blobs themselves are now different. (Unless I'm terribly wrong on this part, in which case, kindly explain me how)
If you want an example, take a situation where I flatten a system of charges completely, to create a sheet charge distribution. We obviously cannot use this formula here.
If you are gonna tell me it isn't a physical situation so I shouldn't worry about it, think of what happens when a battery does work to charge up a parallel plate capacitor? Blobs of electrons inside a thick (somewhat)'wire suddenly redistributes itself into a thin plate? The work we are calculating using the formula would give us wrong results right? (According to my intuition, i think it'll give wrong results)
(I suppose one could consider the whole system of wires and capacitors as a system, excluding the battery, and assert that the change in the macroscopic work would simply be the change in the energy stored in the macroscopic fields, (derived from Maxwell's laws), but it is still not clear what happens to the self energy terms)
QUESTIONS
So what happens to the self energies, they must be different, right? In hindsight, I suppose the formula still gives us the correct result, but it's not at all clear to me why it would. Or whether it would, at all.
Is my physical interpretation of the situation correct? The macroscopic formula, atleast to my interpretation, means this; bringing blobs from infinity. But there could be a more mathematical, less physical formulation of the same, which contains the hidden details that i don't get from my physical picture. Perhaps the averaging procedure could somehow preserve some quantities, like this? Nonetheless, this isn't clear to me, what is exactly happening. If someone could show me that the averaging procedure could bring out these results to clearer light, I would appreciate it.