Please this narration which says that there will be afflictions after me but keep the nation united. We can easily understand the role of Imam Ali after The Holy Prophet.
We want give more details here in the light of above narration.
We want to give example from the Holy Quran, Surah Taaha, when the Prophet Moosa(pbuh) went for 40 nights to get the commands from Allah(swt). He appointed his successor (Aaron) on his nation. The nation left the right path and forgot all the lessons of Prophet Moosa(pbuh).
We can read the dialogues between Prophet Moosa(pbuh) and his successor (20:92-94) [Moses] said, “O Aaron, what prevented you, when you saw them going astray, So that you did not follow me? Did you then disobey my order? [Aaron] said, “O son of my mother, do not seize [me] by my beard or by my head. Indeed, I feared that you would say, ‘You caused division among the Children of Israel, and you did not observe my word.’ ”
In the above verse we can see the reason that the successor of Prophet Moses gave that reason if I fight with these people, you are the one who would accuse me that I have divided them in to groups. We know of course, verbally Aaron tried his best to keep them on to straight path. The successor of Prophet Moses waited for his return.
Imam Ali(as) had same position to Prophet Mohammad as Aaron to Moses. Same thing we say about Imam Ali that Imam Ali did not fight with those people for the sake of Islam. Imam Ali knew it if he fights with those people, the newly formed religion and newly formed Islamic state will get destroyed. (There were lots of dangers against Islam: Romans, Iranians, and Hypocrites etc.) That was not the right time and not in the interest of Muslim Ummah that Imam Ali would use sword against those people.