I would blame it a bit on standardisation… not too much, but when you drop the development of your own cpu, your own operating systems, your own hardware… you’re an oem like the others.
Intel beat them by far with price/performance ratio.
Not to mention, Intel and Microsoft kinda explicitly targeted all the market share that hp and other similar companies were leaving behind… like desktop computing at home.
HP and similar companies just were blind to that, and never adjusted/resized their research efforts to those markets (huge markets obviously).