It's just culinary cargo cult. You grind pepper and other such things because the flavor survives well in the peppercorn but degrades relatively rapidly in air, so waiting until the last minute to grind it results in better flavor. Oxidized pepper is easy to notice the difference in flavor profile and much lower complexity. Especially the pepper shakers that have been sitting at the restaurant table probably yea verily these many years, mostly unused.
Therefore, grinding things at the last minute makes them taste better, goes the simplification.
Therefore, grinding salt must make it taste better.
But salt is not like the aromatic flavors in a peppercorn. Salt is geologically stable. NaCl itself does not need a last minute grind to retain its salty flavors. NaCl is not a chemically complex flavor.
I qualified that as NaCl specifically because it is faintly possible some of the fancy salts could have their fancy flavors come out better if they are ground, but I'm yet to even notice a difference when any of these are used in food in any manner so I can't judge. Those flavors must be awfully darned stable as it is if they're still hanging around in a 99+% NaCl environment. I'd want to see a specific chemical that can survive that but will suddenly wilt if exposed to oxygen. (We're sure not talking about traditional benzene-ring aromatics at that point!) If there is a difference it is hovering at the very bottom of human detectability.
Salt grinders are annoying. They're hard to use because you're trying to grind a rock, a soft rock sure but still a rock. It's wasted effort, and it occurs to me to wonder if they even do anything to speak of; now I want to find one and compare the before and after of the chunk size; I find myself suspicious that many of them are just theatrics and the salt basically passes through unscathed because "cheap plastic" and "grinding a rock" are not compatible with each other. Even if it does do some real grinding it's still a waste though because it was never necessary, you could just have bought it at the right grain size.