This is quoted from Daniel V Schroeder's Thermal Physics:
It's interesting to think about why the slow compression of a gas doesn't change its entropy to increase. One way to think about it is to imagine that the molecules in the gas inhabit various quantum-mechanical wavefunctions, each filling the entire box with discrete energy levels. When you compress the gas, each wavefunction gets squeezed, so the energies of all the levels increase, and each molecule's energy increases accordingly. But if the compression is sufficiently slow, molecules will not be kicked up into higher energy levels; a molecule that starts in the $n$th level remains in the $n$th level (although the energy of the level increases). Thus the number of ways of arranging the molecules among various energy levels will remain the same, that is, the muliplicity and entropy do not change. On the other hand, if the compression is violent enough to kick molecules up in the higher levels, then the number of possible arrangements will increase and so will the entropy.
I've some queries on the above explanation of Schroeder:
$\bullet$ Why does squeezing the wavefunction increase the energies of each energy-level?
$\bullet$ The molecule was in $n$th state prior to compression; how did the molecule remain in the same $n$th state after compression also even if work was done on the system/
$\bullet$ Why is the molecule not kicked up to higher energy level when the compression was slow? Why did the violent compression work otherwise?