The salts and minerals in the world's oceans and seas are dissolved from rocks on land. Streams and rivers carry the salts to the sea.
According to the U.S. Geological Survey, rain is slightly acidic because it reacts with carbon dioxide in the air, which forms carbonic acid. This light acid breaks down layers of rock over time, which contain salts. Though some ocean creatures eat these salts and minerals, they also leave some behind, which build up over time. Salts also come from hydrothermal vents at the bottom of the ocean.
The reason the water tastes salty is that the two most abundant ions are usually chloride and sodium, which are also the two ions that make up table salt.