Action Replay is a tool that alters the programming of a game by re-writing the"language" of the game, called Hexadecimal Coding or Hexcode. when you use a cheat that say makes the 419 Master Balls in slot 1 of your bag encounter the Pokemon with the same Pokedex number, it's due to the AR re-writing the Hexcode to force a wild encounter with that Pokemon's code. That's why AR can crash your game due to over-writing to overlapping lines of Hexcode, which cause a programming error that can either freeze your game, or corrupt your entire file aand delete it. that's want the whole
etc is. that's the Hexcode of the game that needs to be re-written.
just use the minimum amount of codes at once possible,which is less likely to to crash your game.