I see everywhere that a phone should ideally be between 20 and 80% to work efficiently, but I don't understand why, in an electrochemistry point of view. (I'm not talking about the fact that overcharging a phone is bad).
It depends largely on what the cathode and anode materials are. In general, when you charge the phone you remove lithium ions from the cathode. This produces a change in the unit-cell of the material, producing internal strain. This becomes more severe at high states of charge. This strain can cause fracturing in the particles, which causes regions of the particle to become disconnect from the current pathway. The same is true at the graphite anode.
One example I work with is the layered NCA material. Beyond 60-80% there's a dramatic drop in the c lattice parameter, which can be described as the layers "collapsing". This produces internal fractures, which become dramatic at high states of charge and builds up over multiple cycles causing loss of capacity as portions of the electrode become disconnected.