What do gateway cheats edit?

I know it’s not related to Citra, (which is why I marked it “Offtopic”)
but I would like to know something about gateway codes,
what are they writing to??? the RAM? the savegame? the code.bin? I want to
know so I know where to get the offsets and stuff, Please help