Interesting enough, you can often find the equivalent of cheat codes in the accessibility settings. Celeste is a good example.
Another reason for cheat codes: you can give them to reviewers, so they can look at all the content, without having to beat the game the normal, slow way.
It was a TSR (terminate and stay resident, esentially a background process) that you'd load before firing up the game.
Once in the game, at any time you could press a hot key (F12, I think) and it would freeze the game and open a TUI with a hex editor where you could search for values (money, number of lives, whatever else you could think of), change them and go back to the game.
Fun days!
That kind of fiddling was such a big part of my developing an interest in computers and building a solid understanding of how all the magic works internally, it's a bit of a shame that kids nowadays can't really jump into fiddling around like that since the devices they'd play games on are much better locked down (or on PC, require you to already know what you're doing to be able to snoop around in another program's memory).
But for stuff where exact matching wasn't practical like say a more or less continous health-bar, you could instead filter by searching for values that decreased / increased / didn't change.
Of course you would also have to guess at the data type but there weren't that many likely choices.
Either that, or you'd just go about trying one by one until you found it, then tried to figure out a pattern of what was around it and make notes on a paper for next time.
These days multiplayer is always roped into it like with GTA V just so they can milk those sweet microtransactions.
- shoot. loot.
- fast travel, dump loot, fast travel return.
- shoot. loot.
...
Also, BL guns have lots of hidden parameters which may or may not correspond to (or be enhanced by) your build. Playing by green arrows alone is pretty… casual.
I like borderlands but good god is it a slog for me to play because I have to pick up ALL the loot and kill ALL the things and do ALL the side quests so now I'm 40 hours in on my first play through and haven't even beaten the game yet while all the normal people are talking about the new mechanics in super ultra extra hardcore vault hunter mode newgame++++
I downloaded a mod for Fallout 4 to make most things weightless so I could actually play the game instead of picking up every single 10mm round when I don't even use pistols.
God mode for example, that allows to fly through the map, is the OG of fast travel.
Nowadays computers are so powerful you can have full blown editor doing essentially all the cheat codes, but back in the day, you'd want to be testing the construction of X, something you don't have money for, so you'd press a few keys to change hex values and you'd have (maxvalue - current cash) instantly, so you could test more effectively.
Cheat codes would be hidden enough that regular players wouldn't find them but not impossible that players could use them.
I think the logic is, you've paid for the game, you should be able to access all the content.
Nowadays, since games are such big business, it's all too serious.