Water can seperate into layers.
The difference in density, temperature, salinity and CO2 concentrations in seas cause water to separate into layers. This phenomenon is called water stratification:
Water stratification is when water masses with different properties – salinity (halocline), oxygenation (chemocline), density (pycnocline), temperature (thermocline) – form layers that act as barriers to water mixing which could lead to anoxia or euxinia. These layers are normally arranged according to density, with the least dense water masses sitting above the more dense layers.
Wikipedia, Stratification, 2018
So the difference in salinity is one of the factors that separate water into layers. However this was correctly stated in the Quran:
(Quran 25.53) And it is He who merged the two seas; this one fresh and pure, and that one salty and bitter; and He placed between them a barrier and a boundary.
The Quran correctly described sea water separation caused by difference in salinity.
How could an illiterate man who lived 1400 years ago have known about water stratification?
In the Arctic oceanographers discovered a layer 150m thick that acts as a barrier between the freshwater above it and the salty water below it. This barrier is called halocline.
In oceanography, a halocline is a subtype of chemocline, caused by a strong vertical salinity gradient within a body of water. Because salinity (in concert with temperature) affects the density of seawater, it can play a role in its vertical stratification.
Wikipedia, Halocline, 2018
So a halocline separates water layers with different salinities. This was only known recently. However 1400 years ago the Quran described two seas with different salinities and said there is a barrier between them. Today we know this barrier is called halocline.