That's a matter of some pretty strong debate (as are most religious discussions). The more compelling argument (imho) is that Ali derived his claim to succession from the fact that he was related to the Prophet and was a man. Of the companions of the Prophet, no other was as closely related.