Common table salt (NaCl) is a compound of one sodium ion and one chloride ion. On the periodic table of elements sodium is a metal. For most ionic salts such as potassium nitrate neutralisation can produce salts by using a metal oxide as a base and making it react with an acid such as hydrochloric acid. However, sodium is one of the metals that is too reactive with acids to be done safely. Therefore, salt is harnessed from nature.
The most common methods for obtaining salt are:
source: https://www.thespruceeats.com/how-is-salt-made-1328618