Consider all the people you know well. How many have switched from Android to OS X in the last 5 years? How many have switched from OS X to Android in the last 5 years? In my household, 2 switched to Android, 0 switched the other way. In my broader network I'm aware of several more switching to Android, none switching back.
There is a good reason for that. An iPhone with equivalent specs to an Android costs 2x as much. The user experience isn't that much better. (Many people who switch say that the Apple experience was actually worse.)
The cheapest phone that Apple wants to sell you is an XS for about $1000. You can get a top of the line Android for less than that - with specs that beat the best model that Apple has.
So Apple is fighting a rearguard action - squeeze the most profit that it can out of a clientele that is slowly disappearing on them. In this world, they can't afford defects.
So what happens? I personally have an iPhone X because my sister gave it to me as a present. This month the display became non-responsive (that's the bug that has Apple's stock falling). They fixed that after most of a week without a phone. I've now got it randomly deciding that Face ID no longer works, the volume randomly going between off and on, and it recharges when it feels like it wants to. I've got to wait most of a week for them to fix THAT as well. (Have you ever had your phone decide to dial its volume to 0 in the middle of a phone call or listening to a book on your commute? Yeah, it sucks just as much as you would guess.) In the meantime I'm looking at my wife's phone with a growing amount of envy.
When Apple stops being willing to fix their phone under warranty, what do you think I'll replace it with?