How did Egyptian farmers produce surplus food that let cities grow
They settled by rivers and in fertile valleys so that their food could grow better and faster. This eventually also led to not only surplus food, but then people could have multiple jobs each and bring in more money for their family. That's basically how civilization started.
They settled near a water source to be able to grow plants/food.