Complex sentence: The Golden Horde entered into a defensive alliance with the Mamluks in Egypt, with the agreement being that each realm would intervene if the other was attacked by the Il-Khan.
Split into simpler sentences: The Golden Horde entered into a defensive alliance with the Mamluks in Egypt. The agreement was that each realm would intervene if the other was attacked by the Il-Khan.