The ocean contains an enormous amount of dissolved salt.
Most of it did not arrive in one giant prehistoric salt shaker.
The process has been happening gradually through Earth’s water cycle and geology.
Rain helps weather rocks
Rainwater absorbs carbon dioxide from the atmosphere.
That makes it slightly acidic.
As rainwater and groundwater move across and through rock, they dissolve tiny amounts of minerals.
Those dissolved materials enter streams and rivers.
Rivers carry ions to the ocean
Rivers transport dissolved ions toward the sea.
Two especially common ions in seawater are sodium and chloride.
Together, sodium and chloride make the main ingredients of ordinary table salt.
Other dissolved ions are present too.
Seawater is a chemical mixture, not just water plus sodium chloride.
Why are rivers not salty too?
Rivers do contain dissolved minerals.
But the concentration is usually far lower.
River water is constantly moving toward the ocean and being replaced.
The ocean acts as a giant long-term reservoir.
Evaporation leaves salt behind
Water constantly evaporates from the ocean surface.
The water molecules enter the atmosphere.
Most dissolved salts do not evaporate with them.
That helps concentrate dissolved material in the seawater that remains.
Does the ocean just get saltier forever?
No.
Geological and chemical processes remove salts too.
Some ions become part of minerals.
Some are used by organisms.
Some interact with the seafloor and ocean crust.
The salinity of the ocean reflects a long-term balance between inputs and removals.
Do underwater volcanoes contribute?
Yes.
Reactions between seawater and hot ocean crust, hydrothermal systems, and volcanic activity add and remove dissolved chemicals.
Rivers are a major part of the story, but not the entire story.
So the ocean is salty because Earth’s water cycle has been washing minerals off the planet and delivering them there for a very, very long time.
Basically the world’s slowest seasoning process.
A related part of the natural world appears in Why does the ocean look blue?, where the same kind of physical or biological reasoning answers another familiar question.
And that’s the short explanation.
Related explanations: Why does the ocean look blue?, How can fish breathe underwater?, and Why does salt melt ice?