Per The Splendid Table, adding salt to onions immediately after placing them in a hot pan to sauté draws the moisture out of the onions through osmosis. While the liquid is released, the onions will cook a bit faster, have a softer texture that will combine well with the other ingredients in your recipe, and give the onions more flavor.