Xbox 360 had many problems. It was better in PS3 in three specific ways--memory, online network, and price point.
But it was a very cheaply designed box with the largest failure rate in console history, requiring Microsoft to spend over a billion dollars on repairs and warranties. Many gamers still ended up buying more than one due to failure--especially early adopters.
The console had a good exclusive library, and in the first half of the generation many multiplatform games performed better on 360. This began to erode later in the generation when Naughty Dog was holding its workshops for 3rd party developers teaching them how to make games run efficiently on PS3. Xbox also largely rested on its laurels in the back end of the gen while PS3 kept releasing banger exclusives.
Perhaps a major hallmark of the shift is Duke Nukem Forevef. Largely a forgotten game for obvious reasons, it ran like absolute dogshit on 360 but fine on PS3, displaying a photographic negative of the early seventh generation when games sang on 360 but were disasters on PS3.
Sony critically fumbled with the launch of the PS3 but recovered admirably, pulling off one of the biggest turnarounds in only a few years and transforming the PS3 from a laughing stock to a must-own console. Xbox came out of the gate strong with the 360 and slowly squandered its early triumph over Sony as the generation went on. Xbox never recovered from losing the upper hand it had taken, and the unmitigated disaster of the XB1 reveal, lead up, and launch guaranteed they would never regain it.