Honestly, it's never made sense to me how XBox fits into Microsoft's strategy...
I think MS themselves have been struggling with it since the end of the 360 era, where they'd kind of starting believing their own hype. Up to then, it was relatively clear what MS was doing, and what they were doing basically made a lot of sense to both them and consumers. But this all changed with the Xbox One, which was going up against the PS4. Microsoft made some truly bizarre decisions, which are often forgotten now, but the main four killers were:
1) Initially the Xbox One had a Kinect as a MANDATORY part of the package. That was the IR/video motion tracker/voice sensor thing, which for the 360 was a late optional add-on. This made the Xbox One significantly more expensive than it needed to be, at launch. Particularly because all the people buying the Xbox for Madden or Halo - which was probably most Xbox customers - didn't need or want that.
2) The Xbox One would be always on and always online and the Kinect always listening to you/looking at you. This was an amazing way to piss off an awful lot of people at once, but perhaps if MS had apologised and backed off quickly would have been minor, but instead, they doubled down, saying that people were being ridiculous for caring about any of this, and the no Xbox One games at all would work unless you logged online at least once a day! Not even ones on disc! The many obvious objections were raised, and MS basically just told people to shove it, and get with the times (there was a lot of that in the 2013 media zeitgeist, and the public didn't seem to like it much - especially with the now-mostly-forgotten Snowden revelations).
3) Xbox would charge you to play used games. Possibly full price or close to it Just incredible move from MS here. Every game would have to be registered online, and you would only be able to trade them in at "participating retailers", and you couldn't lend games to people, only if you'd had them on your official Xbox friends list for at least 30 days, you could transfer ownership of a game to them. Once. Ever. That game could never be transferred again. It was absolutely demented, overcomplicated and dystopian-sounding and just totally unnecessary.
4) "The Xbox One is primarily for watching TV" - I mean, I paraphrase, but only slightly. The initial reveal and launch really aggressively focused on the Xbox One not as a games device, but as a device for watching TV via (not just streaming, broadcast too), a sort of home video hub more than a game machine. This was wild and senseless. I don't know how much coke was going around the MS boardroom to think this was a good, viable strategy, but it has to have been absolutely truckloads! Despite the bad ideas of the first three, this is where we most saw "MS doesn't even know what the hell they're doing selling a console" vibes. The other stuff was creepy and grasping, this was just pure "We don't understand our own product".
Bonus: MS openly sneered at backwards compatibility and insulted people who wanted it!
Now, over the next few months, MS backtracked hard on all of this because of the obvious and inevitable massive backlash, and points 2 & 3 were resolved rapidly, and a Kinect-less version followed not long after, but this lead to the Xbox One being absolutely destroyed in sales by the PS4 (which wasn't even a good console, really), because Sony were able to basically say "LOL yeah we're not doing any of that, that's all stupid and evil, here's our games machine to play games on and here are good games for it".
The Xbox Series X/S also got smashed by the PS5, but that was mostly because the install base of the PS4 was insanely larger combining with MS just basically deciding to lose on exclusives for complicated and bad reasons.