I think the reason is much more simple - one word: MARKETING ...
Given the fact (to which I agree) that most devs prefer the Unix-based terminal/command line, what options do we have?
Apple offers you an integrated package of hardware and software, off the shelf, which (while expensive) "just works" ... and the choice is very simple - one brand, a couple of models, that's it.
Now, look at Linux (which normally runs on PC hardware) and right away the story becomes complicated and confusing - go to your local computer store (or web shop), look for desktop or laptop hardware, and right away you have a problem - in most cases they will come with Windows preinstalled!
So you then have to choose whether to put up with Windows (which, admittedly, did became more attractive with WSL), or wipe your system and go install Linux. And then look at how many brands and models there are - the choice isn't nearly as straightforward, people suffer from "choice fatigue" - Apple makes it simple.
So there you have it - Apple has a clear and simple (but pricey) offering and a great marketing "message" - the alternative is way more fragmented, fuzzy, confusing and not as straightforward - but also much cheaper, more flexible, and potentially WAY more bang for the buck.
Somehow I have the feeling that a huge opportunity is being missed out on here.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.