Put simply: the altering of games has always existed, even if it's less prevalent today than it was during the '80s and '90s. Some developers also built-in cheats, codes, and passwords for players to use.
Computer games also had 'trainers' made, some even being sold – Castle Wolfenstein from 1981 had one by Muse Software. These allowed unlimited lives, fixing of glitches, and more. In computer games, it was possible for players to 'POKE' data values and change things, with old magazines printing listings of them. Developers included cheats to aid development, from Manic Miner to Gradius. The history of which is so old and entwined it's difficult to find its origins. Much has been written about cheating in games.