In the book of Kondepudi & Prigogine, Modern Theormodynamics, at page 114, it is stated that
In a reversible expansion of a gas, the pressure of the gas and that on the piston are assumed to be the same. If we consider an isothermal expansion of a gas that has a constant temperature T by virtue of its contact with a heat reservoir, the change in entropy of the gas deS = dQ/T, in which dQ is the heat flow from the reservoir to the gas that is necessary to maintain the temperature constant. This is an ideal situation. In any real expansion of a gas that takes place in a finite time, the pressure of the gas is greater than that on the piston.
and they go on showing what happened when they are not equal.
However, I'm having trouble understanding how can such a thing even possible ?
I mean, by definition, the pressure on the piston is the pressure applied on the piston by the gas (it is not like the piston has its own internal pressure or something), so how can a gas apply a lower pressure than its own pressure to an external object. I mean, as far as I know, the way how we measure the pressure of a gas is by means of such an external object, so it really does not make any sense to me.