It is due to several things.
The most important is physical. During charging/discharging lithium atoms move from one electrode to the other. The lithium goes into tiny pores in a sponge like electrode, but when this happens the sponge swells up. Repeated swelling and shrinking eventually causes cracking and fractures in the electrode, degrading it.
The other main effect is chemical reaction in the electrolyte. During charging, tiny amounts of electrolyte material undergo unwanted chemical reactions with the electrode chemicals. Eventually the electrolyte gets polluted with all the byproducts of these reactions degrading it.