The way I see it related to this are the questions who was/is paying MS for windows or who are their customers (at various points in time). At the time counterfeiting was meant to be the main concern, someone was paying for it and the money didn't flow through to MS. Between the cost of windows being hidden away for someone buying a OEM machine or wrapped up in a contract for businesses there probably wasn't many that deliberately chose or were aware of that particular software component in what they were buying. The rise of mobiles and ad networks meant no one thought about paying for the OS software, consumers would never pay for firmware on any other electronics and that assumption followed on so the costs were absorbed by whoever designed the platform, manufacturer or carrier. It pays to be the middleman though, through various app stores.
There's also the move from making an application for an OS (for many GUI tools mostly explored what they need to provide, are 'done' and stable by now) towards clients for an online service, cross platform frameworks or websites where you could argue the browser is the OS shell. I'd guess if there's any strategic failing for MS with windows, it's that they haven't given developers much reason to make apps _for windows_ with things that can't be done elsewhere, even for gaming the constraint is loosening, and a lot of that is driven by AMD/nvidia/intel or following what is getting made for consoles.