Why does salt make sweet things taste sweeter?
Partly because sodium suppresses bitterness, and partly because salt affects how the tongue's receptors respond — the net effect is that sweetness comes forward.
Two mechanisms are involved.
The better established is bitterness suppression. Sodium ions interfere with the perception of bitter compounds. Most sweet foods contain some bitterness — chocolate certainly does, and so do caramel, coffee and many fruits. Removing part of that bitterness leaves the sweetness less masked, so the food tastes sweeter without any sugar being added.
The second is enhancement of the sweet signal itself. There is evidence that low sodium concentrations increase the response of sweet-sensitive taste cells, and that sodium plays a role in how some sugars are transported across taste cell membranes. This mechanism is less completely characterised than the suppression effect.
The practical consequences are well known to cooks. A pinch of salt in a caramel, a chocolate dessert, a fruit pie or a batch of cookies makes the result taste noticeably more of itself rather than tasting salty. Salted caramel is the commercial expression of this, but the technique long predates the trend — salt has been standard in bread, pastry and cake recipes for centuries, and a cake made without it tastes flat rather than merely unsalted.
The amount matters. Below the threshold where you notice salt as salt, it enhances. Above it, it competes.
The same principle runs the other way: sugar suppresses sourness and bitterness, which is why a pinch of sugar rescues an over-acidic tomato sauce, and why acid makes salty food taste less salty.
Fat carries aroma rather than altering taste receptors, so it works differently again.