Foreign dynasty's rise to power in ancient Egypt was an inside job