Salt has been known as a plant killer for millennia. In ancient times, armies used to salt their enemies' lands. Enough salt would ensure that nothing could grow on the land for decades or even centuries. Nowadays, salt is sometimes used as a weed killer in much smaller quantities. A small bit of salt is mixed with water and applied to the base of an undesirable plant. The salt will kill the plant in a few days without harming nearby plants.
Plants' roots are dependent on a process called osmosis. The root membrane is permeable (i.e., water can flow through it). Inside the roots are higher concentrations of salts and other dissolved minerals than in the surrounding soil. Water naturally flows into the root to try to equalize the concentration of solutes. That is how plants suck up water.
How Salt Kills
When you put salt in the ground, however, you change the osmotic balance. The ground around the plant now contains a higher concentration of salt than the root. This sucks water out of the root, drying out the cells of the plant. This causes the plant to quickly wilt and die, sometimes in as little as a day or two. Next time it rains or the garden or lawn is watered, however, it theoretically dilutes the salt to a level that is safe for the rest of the plants. The salt should be harmlessly dispersed.
Using salt once or twice will not cause a problem, but over time too much salt can harm your soil. A dose of salt may harm that particular spot in your garden, preventing anything from growing there again. Excessive salinity over your whole lawn or garden will stunt your plants and weaken them, making them vulnerable to various diseases.