The S rank monster (Mahisha) was summoned during the war of the magi, to conquer Nym. The Black magic users having already summoned Diabolos, it wouldn't be surprising if they tried the same strategy on Nym (apparently without much more success).
I'd assume the (apparently temporary) alliance happened at that moment, to shut down those big bad black mages. "The enemy of my enemy is my friend" kind of thinking.