It has been well-known that companies sell new generation gaming consoles at a loss, meaning they lose money on the initial hardware sale, with the intention of recouping those losses through game sales, subscriptions, and accessories purchases later on. It can actually take a couple of years for console hardware to be sold at a "break even cost". In fact, that's one of the main drivers of the "slim" version of consoles. About 1/2 way through a console's life-cycle the manufacturer finally figures out how to build the same console cheaper but charge the same price.
Console makers are willing to take this gamble on selling the hardware at the loss because they are banking on the fact that you will buy a ton of software later. But this really only works when you give gamers a compelling reason to buy the software on YOUR hardware.
However, in Microsoft's case, they had an absolute hell of a time securing any exclusives after the 360. And even their in-house studios didn't make much that gamers wanted. Thus, hardware sales plummeted. And nobody should ever forget that software sells hardware. Never the other way around.
So I'm actually surprised that Microsoft held on this long. They have been getting their teeth kicked in since the 360. Someone just finally stepped in and said "enough is enough". You can keep publishing games but stop making hardware.