Cats don't understand right or wrong; they exist in the present. When a cat is told "No," he believes it means "Don't let the human see me do this.
You control the cat's behavior through diversion — you can either offer him something he prefers (such as a catnip filled scratcher by the couch he prefers to scratch) or by instituting a deterrent (such as a noisemaker that will go off when he leaps onto the counter.)
However, a cat will not usually cease doing something when you are not present just because you disapprove of what he is doing.
I used to think my cat, Oliver, had no idea what “wrong” meant… until I saw the look.
One morning, I walked into the kitchen and found him halfway on the counter, paw inching toward a plate of scrambled eggs. The moment our eyes met, he froze — ears slightly back, tail twitching — then slowly pulled his paw away and hopped down like, “What? I wasn’t doing anything.”
Cats don’t really understand “wrong” the way humans do, but they do pick up on our reactions. Oliver knows the sound of my “Hey!” means the fun is over, and he’ll bolt or give me that guilty side-eye. It’s not guilt in the human sense — more like, “Uh-oh, the big hairless cat isn’t happy, better stop.”
So yes, I think they know when their actions will get a reaction from us. Whether that stops them from doing it again? Well… let’s just say my scrambled eggs are never left unattended anymore.