From Wikipedia:
(With) a grain of salt is a literal translation of a Latin phrase, (cum) grano salis.
Since in Italy “to have salt in your pumpkin” (avere sale in zucca – pumpkin is a humorous way to say “head”) means to have intelligence and reasoning capabilities, “grain of salt” often means “a little bit of intelligence”. So, “cum grano salis”, in its Latin form, it is often used when it is needed to show that intelligence and personal judgment are needed, as in “I drink wine cum grano salis since I must drive” (with care, moderately) or “please, repair this electric cable cum grano salis” (not scanting, thinking to the consequences or dangers of repair your electric cable). “Cum grano salis” means – like in modern English “with a pinch of salt” – that something should not be taken too literally.