What they do not know will not hurt them.
Withheld information causes no harm to the person from whom it is withheld.
What They Mean
Silence is painless. If the other party never learns of the matter, the matter, for all practical purposes, did not occur.
Are They Right?
Only until they know. The saying insures against discovery, not against the act itself, and discovery has an undefeated record of arriving eventually.
What They Left Out
What they do not know frequently hurts you, at length, in private.