means that
being unaware of certain unpleasant facts may spare someone immediate worry, though ignorance does not prevent actual harm.
similar to
Where ignorance is bliss, it is foly to be wise.
The saying “What you don't know can't hurt you” can be used when that sometimes is better for someone to be ignorant, when things can't be changed.