A lot of early pcs were kits people built, and I remember pc gaming in the '90s and '00s was also heavily focused on custom built machines.
That is why I wrote
"(or often rather: let a good friend build one)." :-)
Seriously: In my opinion (but others might disagree) an advantage of self-built PCs over one that some company produces is that you know exactly what components are inside (in particular you can buy components in which you trust), which makes you far less dependent on driver support by the manufacturer (i.e. you can find drivers in the internet by yourself if necessary). I often had bad experience with driver support by manufacturers (expect for a few well-respected names).
Also lots of cheap PC manufacturers install lots of crapware by default, while your self-built one is a very clean install.
In summary a self-built PC often "just works" far better than a pre-built one.
Just as an example, over at apple.com, the new iMac comes with 32GB of DDR4 2666MHz ECC RAM. To add 32GB (64GB total) they are charging 960€, or 2,880€ to add 96GB (128GB total).
Looking on amazon or geizhals.eu (price comparison site), 16GB ECC DDR4 2666MHz sticks cost 200-220€ x 2 = ~450€ für 32GB. That means you can save 500€ on just RAM alone.
Same applies to SSD storage. And graphics cards. And CPU. And basically anything you could want to upgrade.
Specifically Apple is well-known for their expensive pricing for better optional components (which is often necessary to pay, since for many models you cannot simply replace the component (RAM, SSD etc.) by another one on your own).
Couldn't this be simply explained by the hypothesis that people simply buy their PC parts mostly in the internet instead of a brick and mortar shop?
The kind of experts capable of understanding if they are ordering hardware that is supposed to work together instead of blowing up in some form when assembled, is quite tiny.
Anyone with a modern internet connection and a bit more patience than money (or at least a willingness to learn) can hop on Reddit or PC Part Picker and get a pretty good idea of what is out there and works together.
Compared to the days of making sure you had the right number and type of ISA, PCI, and AGP slots, assembling a PC from parts today is a breeze. Shopping online keeps costs low and places like Microcenter are great for buying in person.
I only haven't built one in a while because my current 5-year-old workhorse media/editing/gaming/everything PC shows no sign of needing a full upgrade any time soon. Sure I bought a new GPU after a few years when I got bitten by the experimental VR bug but other than that, it was an afternoon buying parts and snapping them together, an evening installing software, and 5+ years of "just working".
Cryptocurrency mining has kept the enthusiast hardware market afloat, I have a feeling...
[0]: www.geizhals.eu
Examples:
1070: https://geizhals.eu/?phist=1456548
1070 TI: https://geizhals.eu/?phist=1717563
1080: https://geizhals.eu/?phist=1449277
1080 TI: https://geizhals.eu/?phist=1587606
My personal impression is that while pre-built PCs are mostly sold to businesses, there is a strong growing trend since a few years to build your own PC from parts. I really do observe that if mobility is not an issue, people now tend to move away from laptops towards self-built PCs (or often rather: let a good friend build one). I don't want to go into the details what advantages these have over laptops, but just mention customizability with respect to requirements (e.g. very silent, very high-power, ...) and repairability.
A small (but only small) contributing factor is that laptops do not have sufficient power for VR, so you really need a stationary PC for VR.
The strongest "dampening factors" with respect to this trend are the growing prices of GPUs, because lots of cryptocurrency miners (in the last years in particular Ethereum) hoard them (but it is my impression that this will somewhat ebb away as soon as attractive ASICs for Ethereum get released) and the growing prices of RAM lately. On the other hand the release of Ryzen made building of PCs with either very high-performance or very good cost-benefit ratio feasible.