When we were taught these in the class. There were a few terms I did not understand which my school teacher used. Firstly, they told us that the work in a reversible process occurs at the boundary of the system, an acceptable fact. All the energy is converted yo work done, and then showed us a graph of P vs V for an isothermal reversible expansion, adiabatic reversible reaction, etc. The graphs made sense. But then as we moved towards irreversible process, our sir mentioned loss in energy to the surroundings. I did not understand how, or to what type of energy. Any help is appreciated. Thanks in advance. I am sorry, if there was a conceptual mistake, if so please do correct me.