From what I've read all processes of a thermodynamic system are irreversible because some energy will be lost to the surroundings but I don't understand why that can't be reversed by getting the surroundings to put that energy back into the system. Lets say I have a gas canister with a piston and theres a pile of sand weighing the piston down and compressing the gas to a certain degree. If I quickly take away half of the sand the piston will move up then fluctuate a bit until thermodynamic equilibrium is restored. In real life the friction between the piston and the canister will cause some energy to be dissipated into the surroundings so if I put the sand back on the piston the energy of the gas won't be exactly the same as it was at the start. Whats stopping me from adding more energy to the gas though? Sorry if this seems like a stupid question, thermodynamics isn't a strong point of mine.