The only thing I would add to the above is that it can do those things, not that it necessarily will do those things. Some soils will benefit from gypsum more than others. Sodic (high sodium) and heavy clay soils are going to be the ones that benefit the most from gypsum. Studies measuring the effect of gypsum have mostly been done in sodic soils, so it's value is sometimes overstated for Midwestern soils (which are by far and large not sodic). Sodic soils have a very high pH (>8.5). Saline and saline-sodic soils have similar soil structure issues, but may not necessarily benefit from gypsum.