The correct answer to this open question is the following.
More advanced civilizations were able to develop technology that allowed their citizens to move away from the river and protected them from flooding.
This technology first, allowed civilization to predict the flooding of the rivers, and then to take advantage of the flooding to increase crop production.
Let's not forget that ancient civilizations such as Sumeria, settled in the middle of two rivers: the Euphrates and Tigris. This represented many advantages to farming but also had its risks, basically, flooding. In the case of ancient Egypt, they settled in the banks of the Nile River, and they were one of the most successful civilizations that developed the kind of technology to avoid disasters due to flooding, and instead, growing good crops. The flooding of the Nile left rich soil to grow quality crops that they traded with other towns. The Egyptians also built underground channels to take the course of the water in times of flooding. Thes minimized the risk of massive flooding of their cities.