Because it's a cartoon. They aren't bound by the rules of the games. Do you really think a pokemon as intelligent as Alakazam is only capable of learning four moves? They only keep four in the games for programming reasons, and because having a ton of moves would eliminate strategy in the game, since everything could cover anything. The four moves forces you to pick your moves wisely.