The last Pharaoh of the 20th dynasty Ramesses XI tried to stop the long-term political and economic decline of the ancient Egypt as well as the ruler's power decline, but his effort fell flat. The Egypt was practically divided into two parts at the end of his reign. These parts were more of less autonomous and the boundary was approximatelly set on the level of Faiyum oasis. Nesbanebdjed (Smendes) ruled over the northern part, who was likely a vizier and high military commander there under Ramesses XI rule.
After Ramesses' XI death Nesbanebdjed (Smendes) married his daughter Tentamonhe, usurped the royal titulary and became the founder of the 21th dynasty this way. The settlement city of this dynasty Pharaohs became Tanis, a former harbour of Pi-Ramesses city. The southern part of Egypt was controlled by Hrihor, a high priest in Amun's temple in Karnak.
Decomposition of the Egyptian state
Decomposition of the Egyptian state was undoubtedly related to more and more power centralizing in hands of the dignitaries or even whole families. These dignitaries held high administrative, military and also priest positions, which often became hereditary. Another cause was vast movements of inhabitants in the eastern Mediterranean.
Egypt was the only one that stood up to these changes with every effort, but it didn't manage to defend against the changes in ethnic composition of the inhabitants. The land in Delta was already assigned to the Libyans under the 19th dynasty rule, but especially under the 20th dynasty rule. In most cases the Libyans got to Egypt as prisoners of war. Even though these groups „egyptianized“ pretty quickly, they kept the original social structure and organization to a considerable extent.
Nomadic and semi-nomadic tribes constantly invaded the western border of delta and made the „Libyan element“ even stronger. So the next generations of Libyan residents became a key part of society. On the top of that the mercenaries of Libyan origin became a basic component of Egyptian army for a long time.
Nesbanebdjed (Smendes) and his successors tried to continue in internal and foreign politics of the last Ramesses dynasty rule, which is proved with royal titularies that come out of templates of the New Kingdom period. A special emphasis was laid on the God Amun and it definitely wasn't a coincidence that the rulers of the 21st dynasty replaces Seth (the main God of Tanis till that time) with Amun and other deities connected with Thebes (Waset).