Egypt is mostly a desert, and the vegetation cannot grow in big parts of it. Nile was a water source in a country where water was rare. Additionally, Nile used to flood regularly, which means that big parts of land were moist and very fertile: Nile provided food to the Egyptians (through agriculture).