Xbox lost the console war with RROD on 360.
During the 7th generation, Xbox had made major inroads with the 360. They had their boot on Sony's neck since Sony had majorly botched the PS3 reveal and launch. Blood was in the water. But in their desperation to beat Sony to market on the 7th generation, they rushed the 360's development, cut far too many corners, and unleashed a highly defective product on the public with the highest failure rate in console history.
Just as Xbox could've been preparing to land finishing blows on Sony, they were forced to let up and go put out the fire that was RROD, dumping $1.1 billion into it. Money that could have gone to locking down a lot more marketing and exclusives. Meanwhile, Sony saw their chance and spent the money to secure more deals, to make the PS3 more cost-effective and slash it's price, and they had Naughty Dog teach the rest of the industry how to properly program games for the PS3 so they wouldn't suck.
As Sony began releasing big, heavy hitters for the PS3, in the middle of the geneation, Xbox rested on its laurels after 2010 and Halo: Reach devoting most of their efforts to Kinect. Sony continued to push out huge first party exclusives that defined the generation in the later years of the generation, and then Sony knocked it out of the park with the PS4 reveal, whereas the XB1 reveal was something that Xbox to this day still has never recovered from and never will.
It was the moment of the XB1 reveal that Xbox lost the trust of gamers and they've been flailing ever since to get it back. they made some progress on this front with efforts like backwards compatibility and the initial affordability of Gamepass. But those days are both long gone.
Xbox is a spent force with little left of it that isn't acquired from ABK or Zenimax. There is nothing that can make them recover as a platform holder. They can pretend they are still a platform all they like, but the entire industry recognizes that they are a third party publisher now.