The water is heated by the sun, causing the water to change from a liquid to a gas and it rises into the atmosphere. This process is called evaporation.
The Gaseous water, also known as water vapor condenses on dust and other particles in the atmosphere and form clouds. This process is called Condensation.
After a while, an excess amount of water vapor condenses in the clouds, and this excess water becomes heavy. The excess water is expelled as rain. This process is called Precipitation.
After precipitation, a multitude of things can occur, either the water flows to a large body of water like the ocean again, or it penetrates the ground and becomes groundwater that can flow into the ocean