I fail to see how this answers
@Alan Wynn 's question. If anything, this whole "businesses have to act in the best interests of shareholders" increasingly seems like a copout answer for anyone who only wants to bash a company blind and not interested in talking about the nuances of running a business.
The points you raised are not mutually exclusive. A company can be insanely profitable, and there should still be a system for retrenching people so long as the reason is justified (eg: poor work performance) so that you can free up space for hiring newer, more productive employees. It's part of renewal. That the company earns enough to keep these people on their payroll indefinitely is irrelevant.
Given that the number of people laid off this way does not seem to have been specified,
my guess is that this, once again, a nothingburger that is being blown out of proportion by the media for clicks and views. It seems more like standard changes in business priorities and alignment by Apple, rather than being driven by macro-economic challenges or a desire to boost share prices.