Both companies have different visions of their brands. Apple is after the luxury market, while Samsung wants to be the common electronics brand for everyone. By extension, each companies' focuses will be different. Apple is only focused in making ultra flagship every year, while Samsung has to make dozens of models, from $80 phones to $1000+ bleeding edge foldables.
And then, you're right, there's the experience. Android, in general, are commodity. You can replace an Android phone from one OEM to another without really breaking your workflow. Meanwhile, if you are in the Apple experience, you cannot just replace an iPhone with a Samsung without breaking your workflow. Thus more people inside Apple will likely remain with Apple, while people on Android can switch brands without much negative impact.