I keep seeing entropy change (or reversible effects) and irreversible effects (Joule heating) when reading about charging and discharging of Li-ion batteries. I understand the Joule heating part (the irreversible), but I have troubles understanding the reversible effects. What's going on in the structure of the electrodes that the process is reversible? As far as I know, reversiblities come from the fact that there is no friction or other losses. If one isolates a single ion, the charging or discharging, in my interpretation, would look roughly like in the figure below:
What happens inside the battery during this charge and discharge that would make one think of reversibility? And why is entropy important in this case? And why would a reversible process release heat?