What were the factors that led to the development of civilizations along the Nile River in ancient Egypt?