Why is the water in rivers fresh, but the water in the ocean salty?

The salt content in water is measured in parts per thousand (‰). For example, at the saltiest place on Earth, the Dead Sea, salinity ranges from 300 to 350‰, which means 300–350 grams of salt per liter of water.
Water is considered fresh if its salinity does not exceed 1‰. The salinity standard used to calibrate instruments is taken from the Bay of Biscay, where it is 35‰. For example 🌊: The Atlantic Ocean—35.4‰, the Pacific Ocean—34.5‰, the Red Sea—41‰, the Mediterranean Sea—39‰, the Black Sea—18‰, and the Sea of Azov—11‰.
Why is the sea salty? There is a leading theory. It is believed that during the formation of the Earth’s crust, there was heightened volcanic activity. Gases containing chlorine, bromine, and fluorine vapors reacted with water to form acids. These acids reacted chemically with the solid rocks of the ocean floor, resulting in the formation of salts. About 500 million years ago, the composition of the water stabilized—it became relatively salty.
The main reason river water is fresh is that atmospheric precipitation does not contain salt. This is facilitated by the natural water cycle, which has been ongoing for several million years.