I found a great article about the whys and wherefores of plastic yellowing in classic machines:
The article focuses mainly on the SNES, but mentions old Macs as well, and should apply equally to anything made of the official “this is a computer” grey or beige plastic.
The short version: Plastic is an organic compound (made of basically the same stuff as people) which breaks down over time. As it breaks down, it reacts differently to light and turns yellow. If the composition of the plastic is not perfect (exactly correct proportion of catalysts, flame retardants, pigments, &c.), the breakdown will occur faster. It’s also accelerated by visible and UV light, heat, and oxygen.
The yellowing is caused by the chemical composition of the plastic changing, so it’s irreversible. The author does go on to list some ways to mitigate the damage, but reiterates that there is no non-destructive way to fix it — you can remove the damaged plastic, or cover it.