When rain falls, it reacts with carbon dioxide in the atmosphere to form a very weak acid called carbonic acid. The rainwater falls to earth and gradually percolates through soil and rocks. The rocks are slowly eroded by this acidified rain and the minerals they contain are dissolved into water. The water with its dissolved minerals and salts is eventually carried back to the ocean via streams and rivers etc.
The salts and minerals thus carried to the seas and oceans have been accumulating for hundreds of millions of years. This is because the heat of the sun evaporates the water from the oceans but leaves the salt deposits behind in the same way that distillation works in the laboratory. The evaporated water from the sea forms clouds which deposit more rain over land and the whole cycle starts again.
The ocean also receives salts from undersea volcanoes. In this case, the sea reacts with the erupting molten rock, dissolving out some of minerals. Salts are also dissolved out of the rocks that form the ocean floor.
The salinity of the oceans is more or less constant in a given area because the salt balance is maintained by other influences. Sometimes sea salinity increases because more water evaporates from the sea especially in hot areas of the world. However, salinity is decreased by the formation of new minerals at the bottom of the ocean, dilution via rainfall, melting of ice in the polar regions and usage by marine life.
Thanks to all these influences, the salinity of seawater remains at a more or less steady state and is unlikely to change in the foreseeable future.
Incidentally, the Dead Sea and Great Salt Lake are very salty for similar reasons. These have rivers supplying them with water but no rivers taking away the water. The only way that water is removed from the lake and the Dead Sea is therefore by evaporation. This means that there is less water content in the Dead Sea and