When Egypt was apparently at the height of its powers in the reign of Ramesses II (1279-1212 BC), during what is known as the 19th Dynasty of Egyptian history. Ramesses' greatest enemies were the Hittites, of what is now modern Turkey, a key battle with whom, at Qadesh, was frequently displayed on the great pharaoh's temples.One of the differences between their armies was that while the Egyptians were armed with weapons of bronze, the Hittites had access to a new material - iron.
Although they had ample reserves of copper (the key component of bronze) within their boundaries, the Egyptians lacked the resources to form weapons out of iron. This falling behind in military technology was a contributory factor in the coming decline.
There were also cracks appearing in the unity of the Egyptian state, and its cohesion was threatened by a short-lived secession of the southern part of the country under king Amenmesse around 1200 BC, by the murder of Ramesses III in 1153 BC, and by civil war in the far south around 1080 to 1070 BC.Economic crises, raids by foreign bandits, and tomb-robbing, during which many of the graves of the ancient pharaohs were looted, accompanied these events.
The net result was that for the century from 1070 BC onwards, under the 21st Dynasty, Egypt was split in two, the north ruled by the pharaoh, based in the new city of Tanis in the north-east of the country, and the south by the High Priest of Amun at Thebes (modern Luxor).
The High Priests nominally owed allegiance to the king, but in practice they comprised an independent line of hereditary rulers, whose status was not solely religious, as they also held the title of Army Leader, making their regime probably more of a military dictatorship than a Taliban-style theocracy.
A short-lived national revival began with the accession of Shoshenq I around 945 BC as founder of the 22nd Dynasty.However, within a century, the country had split again, with Thebes now ruled not by High Priests, but by its very own line of pharaohs, the 23rd Dynasty, running in parallel with the Tanite (based in Tanis) northern king.
The Theban kings soon found themselves embroiled in a long-running civil war, while in the north a number of semi-independent principalities grew up, all together sapping the strength of the country as a whole. This decline coincided with the rise of a power to the south of Egypt in Nubia - spanning the borders of the modern states of Egypt and Sudan.
Nubia now had rulers (the 25th Dynasty) who regarded themselves as the heirs of the ancient culture of Egypt, and as such they became overlords of Thebes, and then took over the whole of Egypt, becoming pharaohs of a united kingdom of Egypt and Nubia around 720 BC.
This state was to be short-lived as late in the reign of King Taharqa (690-664 BC), he became embroiled in a disastrous war with the Assyrians, who invaded and sacked many cities, including Thebes. Upheaval back home led, however, to an early Assyrian withdrawal and the setting up of a native Egyptian regime (the 26th Dynasty) that was to last for some 140 years.Egypt fell prey to the expanding Persian empire in 525 BC, remaining under their dominion for over a century.
National rule was revived between 404 and 342 BC, but the various regimes (the 28th, 29th and 30th dynasties) were rife with in-fighting, and the Persians reasserted their power in 342 BC. Egypt was seized by Alexander the Great in 332 BC, but regained independence at the break-up of his empire in 310 BC.However, the new ruler, Ptolemy I, was a Macedonian Greek, and the ruling class of the state was now foreign, running the country as part of the Ptolemaic kings' wider Mediterranean agendas.
The ancient religion and culture were supported and new temples built, but the dominant culture was now increasingly European, with Greek becoming the language of state. By the fourth century AD, the old ways were largely concentrated in the south of Egypt and the remote Western Desert oasis of Siwa. The most important sanctuaries were concentrated on the temple-island of Philae, on what was then the country's southern border.
It was there that last inscription in hieroglyphs was made in 394 AD, as well as the final example of its hand-written form, demotic, in 452 AD, and it was here that the last pagan sanctuaries in the Nile Valley were forcibly closed in 553 AD. By then, Egypt was a Christian country which rejected much of its heritage as indefensibly pagan.
All that survived was the Egyptian language itself, fundamentally the same as that spoken by the first pharaohs, three-and-a-half millennia earlier. And even that was not to last, since with the Arab invasion in 640 AD, Arabic began to displace it, until by the 16th century it was essentially restricted to Church liturgy.I hope this summary begins to explain the answer to the question.