I don’t know that its what Apple does right but that the broader PC market continues to shoot itself in the foot. Little things like pre-installed bloatware and the inability to figure out smooth trackpad scrolling (still!) keep me firmly on Apple devices. And more recently, the M1 platform is remarkable, so I tip my hat to them for that and doing the basic stuff right (mostly—there have been blemishes obviously).
Simple: because a single entity has responsibility for the entire product. PC's are built out of software from Microsoft, hardware from a random supplier (and probably a contractor who agreed to write a driver in a week), and a assembler/supplier like Dell or Lenovo who go for the lowest margin so can't and won't fix any of the mistakes of the other two parties.