How did ancient Egypt become an ancient civilization?

Farmers and nomads began farming there. Nobody really knows the answer but somehow it started with them and I guess the population began to grow and they set up a government established a religion and went on from there!