Answer :

The Egyptians were very efficiently protected by their geographical surroundings; enemy armies would have had to travel long distances through deserts or via boat over oceans to enter Egypt.

Egypt was protected by the Mediterranean Sea to the North and the Red Sea to the East, with only a relatively small strip of land connecting Egypt and Africa with the Eurasian land.  To the South was the Sahara Desert and to the West was what is no known as the Libyan Desert.  Basically, from all directions, enemies would have had to overcome significant geographical borders to reach the Egyptians.