They are in a very weird position. They had so many games in the PS top 10 selling games and yet their last quarterly report the Xbox division performed below expectations. I'm not sure what the answer for them is. I thought releasing games on all platforms would help but it doesn't seem to be helping much at all. The market is flooded with so many good games right now that it's just very hard to compete in that space.
Ultimately, I think it comes down to branding. You make enough bad decisions, and your brand is now connected with bad decisions. The X/S are fine consoles, BUT, they don't care to accentuate their strengths, and instead focus on...I don't even know. "Game Pass" was their one ace in the hole, and they fucked that up overnight by increasing it's price by a substantial amount for seemingly no reason other than greed. I can make excuses for it, as I think you are still getting a lot of bang for your buck, but a 50% increase just like that? People will notice.
They bought out HUGE studios, but for what benefit? Elder Scrolls VI...eventually? These studios have not done anything for them, and it's a pattern with them. They bought "Rare" back in the day, and if it wasn't for some random ass success like "Sea Of Thieves", it would be a complete bust. Now they have a fleet of once great developers just releasing average to shit games, and killing their own brand along with XBOX. There's no quality control at Microsoft. They just throw money at shit and hope it works out.
The only thing I think they have an edge on, is the future of cloud gaming. It's amazing, but it's not something they will have a monopoly over once it really kicks into high gear.
As is, I think XBOX is looked at as some soulless corporate entity, that doesn't put the slightest effort into satisfying their base, and just look at people as numbers. I think they have a vision for the future, but they're trying to force it right now. Cloud/Subscription based gaming is the future, but they have to also think about the now. They don't seem to care about "the now" so much. Maybe they have enough money not to care, but they will get eaten alive, prematurely pursuing that future they envision.