Because they are comparing high-end products against low-end products. Obviously you will not have comparison between a macbook pro of $ 1500 USD against a dell laptop of $ 500 USD. Most Apple users (at least here in Mexico) have never tried a high-end Windows computer (An XPS 15 dell, a razer stealth, etc.)
By tradition. Twenty years ago, still 10 years ago, apple computers were far ahead of any PC or laptop. Currently that gap has disappeared, and you can find performance and performance equipment similar to apple at an equal or lower price.
By ecosystem. Apple uses a closed ecosystem, which allows its devices to work with each other with incredible smoothness. In comparison, windows and linux are designed to support all types of devices, and that means that many times the connectivity experience is not the best, just connect your cell phone, tablet, etc.
By virus. It is true, in macOS there are also viruses, but being a minority OS, it is much rarer to find these than in Windows.
For attention to details. Things like the trackpad, the keyboard, the MagSafe connection, which are not quantifiable, but which give you a better day-to-day use experience.
By status. Apple has managed to transcend from a simple brand to a status symbol, and there are many people who believe that that simple reason makes MacOS better than Windows.
In summary, are apple pcs good? if they are very good. Are they worth what they cost? Probably not, but if you have enough money to make your life easier, go ahead. Is MacOS better than Windows? In my personal point of view, no, in fact I think Windows 10 is more intuitive and flexible than MacOS.