Sure, the explanation in reif proceeds as follows:
The quantum energy levels of a system Er depend on external parameters like Volume, Magnetic field, etc. Er(x1,x2,x3...) In a purely thermal interaction ( only heat is exchanged and work done is zero), these external parameters are not altered. And yet we see a change in the overall energy of the system. But, this change is due to the relative number of systems of an ensemble being on those energy levels alters. Whereas in a mechanical interaction, external parameters do change and so Er which is a function of those would obviously change.
What confuses me is the idea of an ensemble here. It looks like in some cases even though a hotter and colder system is in contact, energy transfer would not take place.!
PFA. (page 66, chapter 2)