Easy: Apple hires TEAMS of designers, UX-experts/engineers [...].
The reward incentives in open source environments are not aligned with the required workload. People who seriously compare any modern linux desktop environment to the UX that macOS delivers must be lost in tunnel-vision/confirmation bias, it's not even close.
Also, like some said, as Apple provides their own hardware, they don't have to deliver general solutions.