Both civilizations were river civilizations dependent on the rivers for their sustenance; however the Nile was far more important to Egypt than were the Tigris and Euphrates to Mesopotamia.
The name "Mesopotamia" literally means "between the rivers" which indicates its geographic location. The rivers were important for irrigation which enabled the civilizations of the area to flourish, and also for transportation which allowed for them to trade with other areas and in turn become quite wealthy. The rivers flooded from time to time, but the floods were not predictable. The Epic of Gilgamesh, based on a flooding of the rivers, is believed by many scholars to be the source of the story of Noah and the flood. The rivers did not provide protection for Mesopotamian societies, and the wealth they gained from trading made them attractive targets for invasion. As a result, many civilizations occupied the area but were overrun by invaders.
The Nile river in Africa also flooded and was important to the ancient Egyptian civilization; however its flooding was predicable. The ancient Egyptians relied on its predictable flooding to plant their crops immediately after the annual floods had replenished the soil. Because of cataracts upstream, the Nile also provided protection from invasion from the South. Since they were protected by deserts on the East and West, the Egyptian civilization was stable for many years. The Pharaoh was believed to control the flooding of the Nile, which was itself venerated, if not worshipped, as the ultimate source of life. The following Hymn to the Nile is indicative:
Hail to thee O Nile, that issues from the earth and comes to keep Egypt alive.
He that waters the meadow which Re created.
He that makes to drink the desert....
He who makes barley and brings wheat into being....
He who brings grass into being for the cattle,
He who makes every beloved tree to grow.
O Nile, verdant art thou, who makest man and cattle to live.