A multitude of reasons, despite the 360 having a year head start, the PS3 still eventually outsold. For as long as both those systems were on the market, with the exceptions of 2006 (PS3 launched in November, so of course the 360 sold better) and 2008, the PS3 has outsold the 360 every single year they went head to head on the market. So Microsoft was never truly able gain an advantage over Sony, not a long term one anyways.
Towards the end of the 7th generation from 2011-2013, the PS3 became the market leader and preferred console of choice amongst consumers. Because Sony was building up the strategy that has largely made the PS4 so successful: Games, superior hardware, games, more affordable prices (they did a lot of price cuts, I don't think Sony EVER made a profit off the PS3), games, games, blu-ray, and finally, GAMES.
So the momentum was already on Sony's side heading into Gen 8. And Microsoft had an uphill battle ahead of them. Chances are, if they both did well with their reveals, the PS4 would have still outsold the Xbox One, but it would have been a much closer battle than it ultimately turned out... If they both did well with their reveals.
That God Awful Xbox One reveal in 2013 was arguably the biggest shot in the foot in gaming history. To this day, I have never seen a company fall so flat on their face, not even Nintendo with the Wii U. Just an absolute dumpster fire. Everything that COULD go wrong, DID go wrong.
The DRM, always needs to be online, used game policies, mandatory Kinect, less powerful hardware, overemphasis on TV on a VIDEO GAME console, a severe LACK of video games, and $499.99. From that moment on, Sony won the fight before it even started. Microsoft set the bar so low, all Sony had to do was NOT fuck up and they'd win by default. Just about anything would have looked better by comparison.
Ever since then, Microsoft has been trying to recover from the damage that reveal caused. They still haven't completely gotten over it, but they have come a long way. I still think that the PS5 is going to outsell the XSX, but I think it'll be much closer than the PS4/XBO head-to-head was.