The complex societies of both Mesopotomia and Egypt emerged in river valleys

The complex societies of both Mesopotomia and Egypt emerged in river valleys. How do you explain this phenomenon? How are these societies similar? What are the key differences? Please include as much info as possible