Salt was an important seasoning from the Westfarthing. Samwise Gamgee brought salt with him on the journey to destroy the One Ring. He almost lost it in the Emyn Muil, but it was saved by Frodo from the Hithlain's long fall down the mountains. Although it can't be said for sure, salt was probably very valuable as a preservative in Middle-earth, as it was in the real world before the invention of better food preserving methods.
Is it unknown where the salt was actually harvested, as the name Salt from the Shire might imply that it was mined or harvested from salt flats within the boundaries of the Hobbit realm, however it is not implicitly told that the Shire has any such locations or industries to support such an idea, so it is more likely that the salt is either Dwarven-mined from salt veins and purchased from wandering traders or merchants of Bree, or gathered and dried from the sea water from the ocean shore that is rather close to the Shire's western borders and dispensed in likely the same way.