The salt is very important from a safety perspective, yes. The good, desirable, lactobacillus bacterial cultures that will produce a safely fermented product don't always or naturally overwhelm "bad" or undesirable cultures. You have essentially no control over the mix of bacteria in and on whatever you're fermenting; all you can control is the starting environment. The purpose of the salt is to make that environment more favorable to lactobacillus, and less favorable to other stuff - mold, spores, potentially harmful bacteria that is inhibited by salt.
Lactobacillus can tolerate a saline environment; another place it lives is in your own gut (it's a major part of the human digestive microbiota) which has a fair amount of dissolved sodium. Adding salt to your ferment helps create an initial environment in which primarily lactobacillus thrives, giving it time to rapidly take over, crowd out other bacteria, and eventually produce enough lactic acid to prevent other salt-tolerant cultures from growing.
Why 2%? Much less won't inhibit other bacteria enough; too much will also impede the desirable lactobacilli. The good cultures simply "like" that salt concentration.
As far as absorption, I would expect that through osmosis the salt balance would roughly equalize inside and outside the vegetables. There will be some initial water weight inside the vegetables not included in the 2% ratio of your brine; how much depends on the vegetable and quantity. The water ratio in the brine may also increase slightly due to evaporation; it's probably conservative to say that this effect will be no larger than the water drawn out of the vegetables, and that the maximum salt content of the final fermented vegetables will be no higher than 2% by weight.