I think the issue is such things as, say, robbing someone of some money. If you think you might be caught, then perhaps you wouldn't. If you think you might not be caught, then you perhaps would. If you think it is wrong to do so in the first place, then you wouldn't even consider it. You can, of course, extrapolate such a simple example to all sorts of other aspects of moral behaviour.
My feeling is that I have a sense of what I deeply believe is right and wrong. That doesn't mean I don't sometimes find myself faced with a moral dilemma but I have some core values that have nothing to do with being caught by the police, exposed by family and friends or consigned to eternal damnation.
However, I do think there is an element of human nature that believes if it can get away with it, then it's okay – conscience and cowardice, perhaps.