Yep, Sony was actually in third place for the first few years of the PS3/360/Wii era. Wii got the kids/families/dweebs, 360 got the adults. PS3 was priced higher than the others but it had blu-ray player support which was still novel at the time and I don't think 360 had that. It wasn't until blu-rays became ubiquitous and PS3 got some major exclusives like the Uncharteds and God of War that people really started switching over to it. Not sure when it overtook Microsoft but Sony was firmly in the lead over the other two by the time PS4 dropped.
It's hard to believe Microsoft is doing so badly now, but at the same time it isn't hard to believe at all. Their console-naming was abysmal from a marketing point of view. XBox One being their third generation? XBox Series X, not to be confused with XBox One X? And how do the S's fit in? Who knows! The average idiot wants things to be simple. PS2, PS3. iPhone 7, iPhone 8. Or at least clearly-defined. Gamecube, Wii. (Wii U was a misstep on par with Microsoft's marketing mistakes)
Side note: That time period where Blu-ray was catching on and HDTVs were becoming an affordable mainstream thing was a magical time. I still remember my first HDTV (a crappy Sylvania that could only go up to 720p) and playing my first HD game on it, Bioshock. That was less a game and more of an experience. Metroid Prime for the next generation, that's what Bioshock kinda was. The tech was snowballing so fast at that point that it felt like the sky was the limit, and I've never been more hyped for a console than I was for the PS4.