Apple was against it because if you have parts, you can build counterfit iPhones and stuff (read about that rationale years ago, take it with a grain of salt). Also, the repair market is quite lucrative forcing customers to buy new devices than actually fixing them. They were doing this with iPods way back in the day with irreplaceable batteries or batteries so pricey, “you may as well buy a new one”.
No idea why they changed their tune. I could only imagine their revenue streams have leaned more into software now but I’m just an idiot online, what do I know.