Salt caves are an extremely rare variety of karst caves. They are formed by solution of salt by rain water.
If you think about this, you may imagine how rare this is. Salt is easily soluble by water, so any occurence of salt gets washed away very fast. Much faster than typical movements of the crust, so salt normally does not even reach the surface in areas with humid climates (high precipitation). Normally the salt is soluted in the area of the ground water producing salty springs, which were used by man for thousands of years.
The main prerequisite of the formation of salt caves are salt outcrops at the surface in arid (desert) climates. Even in arid climates with their low precipitation, there are some rare events with rain. At this events the rain water forms huge and wild rivers running down the wadis, the desert valleys. This water forms solution caves in salt deposits it reaches.
Despite the very rare rainfalls, the life of salt caves is very short. Water solutes a high amount of salt in a very short time. The life of a salt cave may take several thousand years or only some years.
The main mineral of the so called salt rocks, is the well known table salt which is used in the kitchen. The chemical name is Sodium Chloride (NaCl). As a mineral it is called Halite. But the rock also contains various other salt varieties with similar chemical characteristic.
There are two famous salt karst areas on the world, one in Sedom in Israel and the other in eastern Spain.