In general a Game Genie was designed to sit between the console and the cartridge and when the console asked the cartridge for data the game genie could secretly change it before passing it back to the console.
So for example you have a game where you start with 3 lives. That number 3 exists somewhere in the data or code on the cartridge.