Rivers deliver, the sea keeps
Rain is slightly acidic, and as it flows over rocks it dissolves tiny amounts of mineral salts. Rivers carry those dissolved salts to the sea — far too dilute to taste. At the ocean, water evaporates and leaves the salt behind, so over hundreds of millions of years the salt has concentrated to today's roughly 35 grams per litre of seawater.
Underwater volcanoes and vents on the sea floor add and exchange minerals too. The ocean's saltiness is the balance point of all these deliveries and removals, and it has been roughly stable for a very long time.
Not all seas are equal
Warm, enclosed seas with high evaporation, like the Red Sea, are saltier than average. Seas diluted by great rivers and rain, like the Baltic, are noticeably fresher. The Dead Sea — actually a lake — is so salty, around ten times the ocean's concentration, that swimmers float high and almost nothing can live in it.
If all the ocean's salt could be dried and spread over the land, it would form a layer more than a hundred metres thick: the accumulated memory of every river that ever ran.

