"A save file can become corrupted due to various factors:
interruption of the saving process by shutting down the system or removing the Game Card
cheating
abusing certain glitches
Physical damage to the game cartridge, such as from dropping it, may result in corruption of the save file in games of the first three generations. Improperly set cartridges (and memory cards in the case of games for the Nintendo GameCube) may cause data to be read as corrupt. In such instances, turning the system off and reinserting the cartridge properly will cause the data to be read correctly. In the first two generations, save data is stored on a RAM chip powered by a battery when the game is turned off. If the battery runs dry, the save data is deleted constantly due to the RAM not being powered on."
https://bulbapedia.bulbagarden.net/wiki/Save