In the usual formalism of thermodynamics, the internal energy of system is said to be extensive in a sense that if we construct n identical copies of same system, the energy of the composite system will be n times of the energy of the subsystem.
The above statement is related to multiple copies of “identical system”.
But in some derivation of the equilibrium condition, even two subsystem is not identical, we still assume the additivity of internal energy.
$$E_a+E_b = const.$$
Does this make sense?
If two system when brought into contact (removing the wall) start reaction violently, the energy should be different from the sum of subsystems before removing the wall?