It is an old controversy but an older way to deal with illness. Salt irritates fish and makes them produce more slime coat. It also pulls fluid from them and can dehydrate them.
Most people don't use salt of any kind in freshwater tanks. There are much gentler meds for fish disease these days.
the simple answer is both, but many people strongly advise against using salt as a stress readucer now that we know more about its affects on fish. Salt is great for treating ich if you have fish that are very tolerant to salt because it is very effective in killing the ich tomites before they can attach to a new host so it is still often times used to treat ich. Many pet stores will tell you to keep salt in your water to help prevent sickness, in most cases this is a terrible idea... While some fish are very tolerant of salt, such as mollies, some fish will die from too much salt exposure such as many loaches. Salt acts as an irritant to fish, it causes them to build up a thicker slime coat but long term it will likely stress the fish out if it does not come from an environment that has somewhat salty water. Salt has many medicinal uses in the aquarium, but I would not recommend using it long term. If you want something to boost your fishes immune system, try out stress coat+ water conditioner to build your fish's slime coat, garlic guard to boost your fish's immune system, and vitachem to provide your fish with the vitamins they need.