Because the effects of heat transfer.
If the difference in temperature is large, the process can't be reversed. Heat is a form of energy that can transform into an increase of the molecules' movement in a system and if the system is water, and this water is hydrostatic, the kinetic energy will become pressure. So to reverse this, you need to do a refrigeration process which requires work and so it affects the surroundings, so the process then can't be reversed.
If heat transfer is due to infinitely small amount of temperature difference, the process can be reversed without refrigeration process and keeping the surrounding intact.
Now transferring an amount heat through an infinitesimal temperature difference would require an infinite amount of time, so in other words, rate of $Q$ transferred is infinitely small, making it possible for us to reverse the process because the temperature of the lower temperature body and higher temperature body would stay constant. So no kinetic energy and the process here is isothermal!!
So here you go
Now about about the example you shown, one process is reversible and the other is not even though they both goes through the same process and pass exactly the same state. But one is reversible internally and externally, the other would affect the surroundings.