After the death of Muhammad, his close friend, Abu Bakr, and his cousin, Ali, both had claims to the title of Caliph, and although Ali gave up, this began the Sunnia-Shia debate.
Abu Bakr still had to fight the Ridda Wars (632-633) against tribes that said they owed him no loyalty to a non-relative of Muhammad.