The idea is that they don't understand if they've already done it and gone on to something else.
If you catch them in the act, that's when you say "NO
!", take them outside and say "GO POTTY" the praise them when they do.
They do understand when you catch them doing it, you just can't punish them later if you find it after the fact.