For many years, scientists didn't know exactly what the cause was for the oceans being salty, as a matter of fact, the true reason was only discovered fairly recently.
For many decades scientists assumed that the ocean got its salty chemistry from rivers which are known to carry composites of minerals and chemicals into the oceans but in recent discoveries, it shows that the chemistry of rivers and the oceans differed greatly and that rivers were not responsible for the ionic compounds of sodium chloride.
It wasn't until 1979 that scientists discovered geothermal vents on the seabed that eject superheated water from deep within the crust of the earth that contain hundreds of types of minerals and has now been proven to be responsible for also giving the ocean its salty chemistry amongst other composites that scientists now believe contain the building blocks of life and possibly hold the key to answering the origins of abiogenesis.
Take a look at the video below by the YouTube channel: National Geographic on TIL: Why Is The Ocean Salty? - Today I learned...