Why did Ibn Muljim came against Imam Ali (a.s)?

Ibn Muljim considered himself a learned man and considered his decisions more appropriate in comparison to that of Imam (a.s), When he found Imam Ali (a.s) & Muaviyah against each other in the war he didn’t try to get the correct understanding of the situation and instead planned to assassinate both of them.