The oceans that are salty today have its salt as ancient origins. When the earth was formed, gases which came out constantly liquidified and resulted into formation of oceans and the salts which are present in it today. Majority of them include sodium, chlorine, sulfur, calcium, magnesium and potassium. Chloride and sodium make up about 90 percent of the salts that are present in the oceans.
The salinity of ocean remains usually constant throughout the year. The water which gets evaporated leaves the salt behind it and when the condensation of clouds occur, the same water returns the oceans through different modes. The rain water is slightly acidic in nature due to the presence of the carbonic acid. This rain water also erodes the rocks of the mountain containiing a huge amount of different organic salts which then flows down through rivers back into the ocean. Thousands of rivers and streams which carry several ions when they flow over the land are poured into the oceans. The reason for the water being fresh in the lakes is its stagnant water which changes yearly. The rapidly changing water keeps the salt in the lakes at its bottom and water at surface fresh forever.
The amount of salt in the oceans is very high. According to the estimates, if the salt in the ocean is removed and laid flat on the land, it would occupy a length of 25 storey building! Techniques need to be developed to extract these salts from the oceans commercially on a large scale.