A grain of salt is a literal translation of an ancient Latin phrase, cum grano salis.

"Salt", in Roman times, was what was called the brains within the human head, or perhaps was what they believed filled the human head. The Latin expression was thus a proverb of sorts--meaning that, in everything, we should use at least a grain of intelligence or understanding. It was, then, a recall to common sense--a reminder of prudence and reflection before action.

To take 'it' with a grain of salt now means 'to accept a thing less than fully.' The Oxford English Dictionary dates this usage back to 1647. The terms are not dissimilar -- both essentially mean to regard certain things with some understanding and common sense.