Well, you need to be ahead and be able to have worse hands call you.
If you can get enough better hands to fold, or worse hands to call then you should cbet. That's really the core idea.
So for KK on an Axx flop, if they have an ace they'll always call, and if they have pairs under KK, they'll likely fold making it check instead of a bet. Now, if the flop has sufficient number of draws on it where they could have like a pair and a gut shot or a pair + fd, we can bet KK for some value.