Some more granularity about Medieval Egypt.
There were a number of large and powerful Arab tribes that had settled up and down the Nile valley from about the 800's. In fact, in close historical time to the discussion, one of those powerhouse tribes, the Ja'al, had moved down to take over the lands south the First cataract, conquering Nubia et al. While their numbers were a bit reduced in the 12th century (the toughest two tribes were encouraged to go West and restore the truth faith), basically, they did run rural Egypt and successfully transformed it; the process of cultural Arabization that occurred throughout North Africa as wave of tribes moved west over the centuries past the initial Jihad. Likely, they would be giving serious grief to any infidel invaders.
(One of the key tells about how the country was changed was that in 1131 CE, the Coptic Pope declared that Arabic was to be one of the liturgical languages - which informs how Copts were being assimilated).
Most of an extensive and vibrant Jewish community had migrated some centuries past to the Maghreb and Spain - fortunate for them in this scenario, but bad for both real and imaginary rulers; they were high-value added folk, so to speak, for local economies.
The native population was heavily disease ridden - which may explain why they tended to remain below the carrying capacity of the land, i.e. less than what could be supported with little problem. Bilharzia, malaria, tuberculosis were endemic - the first being a particular condition to the Nile dependent population.