I mean they're not connected. They can have unrelated canons. Like how the Sonic series has a separate game and comic canon.
...You can't really trace most of the anime stuff to the games, no. -_- Not in the way you think it does.
Because they weren't based upon the games to begin with, but unique anime portrayals. That's the point. The anime does its own thing, and doesn't really emulate the games much at all beyond attack names(but not animations). They're just that separated. The anime Pokemon only loosely behave similar to the games, usually in personality. But most of the attacks have anime animations that eventually get transferred over to the games. They can't really be traced back to the games as is. They're just loose ideas of what it could have(as the games didn't have any real animations till Pokemon Stadium, which came out way later after the anime. And many of those animations aren't used in the anime either. One of many examples is what become of PIkachu's Final Smash. It works nothing like it does in the anime or games as it has no strict animation in the games, and is more like a running attack in the anime. It's one ability that definitely wasn't from the anime, unlike Ash-Greninja, Shadow Ball, and Aura Sphere's animations).
The only anime that actually traces properly back to the games is Pokemon Origins. That's literally it. The rest are their own thing entirely. And always will be. That's the choice the staff made, to advertise the Pokemon from the games, but not really what they're like in the games itself. They're significantly different, to the point of using impossible moves on average. Pokemon behave widely differently from the games in the anime to an extreme degree. It actually wasn't till far later than they somewhat resembles their game abilities more, which actually somewhat became a thing once RSE came out, where Abilities were a real thing. That's the first time the games more heavily influenced how the anime worked, instead of it being a completely separated advertisement for the Pokemon(and sometimes items) themselves only. To be honest, I'm questioning if you have heavily seen the anime? Or if you only saw the last few seasons, which was way more accurate to the game portrayals. Cause in reality, the first three seasons of the anime(Kanto, Orange Islands, Johto) were entirely unlike the games. The games actually first took anime notes into account with Pokemon Yellow, and the third versions are loosely akin to Yellow in the way they feel kind of like they're anime-inspired(by making it so you can get both box Legendaries, not unlike how Ash often meets both). The next major one was the Sevii Islands being based somewhat upon the Orange Islands, by not only having Lorelai live there(a strict thing from the anime only), but the ability to find non-Kanto Pokemon there(another factor originating from the anime). The anime was never about portraying the games accurately regardless. That wasn't its purpose. It's more merchandise-driven than anything else, including making it so you can know who the Pokemon are from the games(but not about portraying 'em similar to the games correctly. That's not an important part whatsoever).