Why is the work done in reversible process greater than work done in irreversible process?

Its almost true. Of course, Jamie would beg to differ.

However, the general logic is simple. If you have something that's irreversible, energy is lost. That energy was work that could have been used to produce valuable work.

If you consider this gas expansion as part of a cycle, then it is more clear that that irreversability calls for more work to be done to reset the system, and that is where the saying comes from.

What makes it difficult to understand is that many of the more expressive uses of expanding gas, such as Jamie's example above, are one-shots which waste a considerable portion of their energy. In exchange for wasting that energy, they can be constructed to hold onto a much larger total energy and emit that energy rapidly.

Hence, "don't try this at home."

The reason why more work is done in a reversible process than an irreversible process is in an irreversible process entropy is generated within the gas whereas in a reversible process entropy is not generated. That additional entropy has to be transferred to the surroundings in the form of heat, leaving less heat available to be converted to work.

To elaborate, since entropy is a property of the system, the difference in entropy between two equilibrium states is the same, regardless of the process (reversible or irreversible) that connects the two states. Consequently, in an irreversible process the additional entropy generated in the system must be transferred to the surroundings in order for the change in entropy of the system to be the same. The only way to transfer entropy to the surroundings is to transfer heat to the surroundings. This means more heat has to be transferred to the surroundings in an irreversible process than a reversible process. That leave less heat to be converted to work for the irreversible process than the reversible process.

Hope this helps

Thermodynamically the reversible heat is defined as TdS and dS>Q/dT according to the second law of thermodynamics. According to Transport phenomenon the heat of compression/expansion is given by $$ \rho c_p \frac{\partial T}{\partial t} = - (\nabla \cdot q) -(\frac{\partial ln( \rho)}{\partial T})_p \frac{DP}{Dt}- \tau:\nabla v $$ so energy is lost as heat as a function of DP/Dt how fast we compress the gas or a non reversible process. also the last term is the viscous dissipation