Why do games allow cheat codes?

We've all entered cheat codes into games to unlock special modes, to obtain weapons, to give ourselves infinite ammo, or extra lives. The reason those cheat codes exist is that the developers knew their prospective players would want the option to play the game in those ways: to skip levels and open up options .