It is not really true, and depends heavily on what level of quality, comfort and support you expect from your devices.
For windows machines Microsoft happily gives all the reasons to switch to mac, even considered that the new macs are less of workhorse than previous generation. The level of problems I observe by my colleagues, all working on MS Surface and various Lenovo laptops is mind-blowing. There is everything: bluescreens, network problems, problems with peripherals, update problems. Have in mind, that those are corporate machines, where updates are more tested and in general 1 year behind a plan. I guess, a “normal” win10 installation must be a living hell. Most of them told me they will switch to mac by the next occasion (we ran a 3-year cycle on you machines). These are pretty basic problems, not some luxury stuff relevant to us, nerds, like “windows is meh, because there are less to none automation tools”. Also, windows 10 heavily lacks in data protection, which is a topic here, in continental Europe.
For phones, the picture is different and heavily depends on what you expect. If you go for low-level devices, apple offers you nothing good. If you go for high-quality devices, apple devices may be a good offer, since android devices are getting obsolete pretty fast due to lack of updates. If you have to buy 2 devices on the level of Samsung Galaxy S* within 3 years the TCO gets pretty high. Also, in high-price segment other considerations play a role - data security (hello, google) and the quality of software, crapware from android vendors and so on. I’ve had a talk on it with a friend of mine yesterday, where he had 3 android phones in a row all having different problems - with IPv6, LTE connections, calls dropping after 29 min 50 sec and so on. This is, of course, only anecdotical evidence - he may just have a bad luck. But judged on my own android time, how these devices work is certainly a problem.
iPad is simply without any comparable competition, as AW.
I would say, the problem for Apple is that the biggest argument for their products is just how crappy the competition is as a whole. There are huge problems with windows and android everywhere. Should they really get better Apple, as slow as it is these days, may be in trouble. On the other side, judged by the history of google and MS products quality, I don’t see a big danger coming from this side. Also, apple could earn maybe a quarter of what they earn today and still be a very, very profitable company. The problem is not Apple, but just how mad and profit-driven the financial market in US is in last decades.