Dear A Moment of Science,
I know why the ocean is still salty: evaporated water leaves the salt behind. But how did it get salty in the first place?"
According to one hypothesis, oceans formed at least 500 million years ago when water vapor and other gasses escaping from the Earth‘s interior gradually formed the atmosphere and clouds surrounding the planet. As the earth cooled below the boiling point of water, rain began to fall, and kept falling for centuries. Eventually the rainfall filled the Earth‘s hollows and formed oceans.
Salt of the Earth
In their infant state these oceans were not nearly as salty as they are today. As the initial rains swept over the planet‘s surface and filtered down to the hollows, the rushing waters picked up chemicals from erosion of the Earth‘s crust. These chemicals included sodium, which is one of the main ingredients of salt. The other main ingredient, chlorine, came from the solid and gaseous fallout of land and ocean floor volcanoes. Over hundreds of millions of years the steady flow of chemical-rich rivers and streams and the eruption of volcanoes and undersea vents combined to increase the oceans‘ salt content.
This does not mean, however, that the oceans‘ saltiness is constantly increasing. Scientists believe that ocean salinity reached a plateau hundreds of millions of years ago, when roughly the same amount of salt fed into the oceans was deposited as sediment on the ocean floor.
"Why Is the Ocean Salty?" (U.S. Geological Survey)