Well, ancient Egypt was not the desert it is today. In fact during the time of Pharohs and Pyramid building it was vastly different.
Great rivers ran through and the land was filled with tropical forests. These made the area a highly desired trading spot as there was agriculture aplenty.
cheers