From its humble origins as a cluster of rival chiefdoms along the banks of the Nile, ancient Egypt rose to become one of the most advanced civilizations of its time.