Generally, it's the games. Though, with XY&Z I really prefered the anime.
It's also fair to say that the anime can sometimes get to play the games (or replay, actually) more sometimes. Credit where credit is due.
I can sometimes agree with your point, since with BW I hated the anime but loved the games, and while I didn't find the XY games bad I generally liked the anime of that saga better. SM seems to be shaping up as another generation where I prefer the games over the anime, but I guess it's because I hate Ash's redesign.