The climax of the first civil war came in the form of an arbitration
between armies of Ali and Muawiyah.Khawarij later become opposed to this deal and hatched a plan to assassinate both ALi and muaiwyah ( along with amr b a'as who was an ally of muawiyah )
Assuming they kill all 3 and their supporters are in disarray, the khawarij gain on this confusion and discord.Their egalitarian form of leadership ( no privilege status of quraish as espoused by both shia and sunni) appeals to people and they establish a unified caliphate in Hijaz, Egypt shaam and Iraq