I am a high school student and I am a little confused in a free expansion of gas, My teacher told me that when an ideal gas expands adiabetically against vacuum there is nothing on which the gas does work so, it doesn't exchange any energy or we can say work done by the gas is 0, but for real gases the internal pressure does some work to expand against the internal intermolecular forces ,so the work done by the gas is not 0{it means the gas is doing work on itself), but if that's the case, then in previous case also the gas is expanding due to the internal pressure, i,e due do the pressure, gas molecules exerts forces on each other due to which gas rushes inside the chamber having vacuum so it must have done some work on the gas molecules to move or expand itself but why do we only consider the work done by the gas on the atmosphere always? why don't we consider the work done by the internal pressure of gas to expand itself?
more clearly, let's assume a general case and not free expansion, say if gas is applying some force on the massless piston doing some work on it, by newton's 3rd law piston will apply some force on the gas in opposite direction of its expansion, but then still what is causing the gas to expand? of ofcourse its internal pressure which is applying sort of forces on the molecules that's why they are getting farther apart? then why do we not consider the work done by this pressure on the gas molecules? by just saying that there no force to oppose so gas pressure is not doing any work, you are simultaneoulsly agreeing to the statement that if a block of mass M is placed on a frictione less surface and another identical mass is colliding with it with some speed, so the force acting during the collision will not do any work on the mass which was initially considered to be at rest, same argument here is that internal pressure (due to the bumping of molecules) will surely procide some energy to the gas moleucles to rush, but since there is no opposing force how can we say that it will no do any work?