Ancient Egyptian religion was polytheistic, and the pharaoh was considered to be the earthly representative of the gods. He was responsible for ensuring that the Nile River flooded regularly, as this was essential for the fertility of the soil and the success of the harvest.
The pharaoh would perform rituals and ceremonies to ensure that the Nile flooded, and if the flood was particularly good, it was seen as a sign of the pharaoh's favor with the gods. Conversely, if the flood was poor, it could be seen as a sign of the pharaoh's displeasure.
Additionally, the pharaohs were also responsible for building and maintaining the canals and irrigation systems that were used to distribute the water from the Nile River to the fields.
By controlling the water supply, the pharaohs could ensure that the crops received the water they needed to grow, which further increased their power and prestige.