Everyone, at some point, has used a cheat code, glitch, or other aid that helps them conquer a level more easily. Games are enormous fun, but they can also be frustrating at times, and the desire to seek a bit of extra help can prove irresistible.
And most of the time... you'll get away with it scot-free. Sure, in online games there's a bigger chance you'll be caught red-handed, but in single-player experiences it's often super easy to cheat your way to victory, and heck, some titles even allow you to use magic infinite-life codes with no consequences whatsoever.
But sometimes, the developers will be watching you. Sometimes, they'll expect you to cheat in a particular way, or in a particular section of the game. And sometimes, they'll be prepared for it.
From decades-old titles like Gradius III to recent hits like Batman: Arkham Asylum, video game creators know that we're all just a bunch of lazy buggers who want to complete things as quickly and easily as possible, and for that reason, they laid some neat little traps in their games to call out or punish cheating players.