Salt added at the end sits on top of food. Salt added early becomes part of it.
Food that tastes flat has usually been salted once, at the table, after everything else was finished. The salt is there. It is just all on the outside.
Salt needs time and moisture to move. Put it on a piece of chicken an hour before it cooks and it draws out water, dissolves, and is drawn back in carrying the seasoning with it. Put it on afterwards and it stays where it lands.
This is why a recipe will tell you to salt the onions as they soften rather than the finished sauce, and why pasta water should taste of the sea. Every stage that can carry salt should carry a little of it. The total is often less than you would use at the end, and the result tastes more of itself rather than of salt.
Two practical notes. Different salts are not interchangeable by volume: a spoon of fine table salt holds far more salt than the same spoon of flaky sea salt, so a recipe written for one will oversalt if you use the other. And salt that is going into something that reduces should be held back, because the seasoning concentrates as the liquid goes.
Taste as you go. Not at the end, when the only correction left is more salt.
Photograph: goblinbox_(queen_of_ad_hoc_bento) from Minneapolis, MN, US — CC BY 2.0, via Wikimedia Commons