On various occasions, the companions of Prophet Muhammad (PBUH) stressed the importance of appointing successors. According to a famous Hadith, Hafsah (the wife of the Prophet and daughter of the second Caliph) asked her father to choose a successor after himself. Abdullah ibn Umar similarly addressed his father, saying: “If your shepherd leaves your livestock without a guide, you would complain to him saying, why did you cause their destruction. Therefore, think about the people of this nation and appoint a leader for them” (1).

Even when Muawiyah entered the city of Medina, he sought to obtain the people’s allegiance for his son Yazid. He said to Abdullah ibn Umar: “I am afraid that I will leave the community of the Prophet to themselves similar to when a shepherd leaves his sheep (alone)” (2).

History has shown that the Prophet (PBUH) has left individuals in charge of Medina during his absence for battles. During the Prophet’s absence for at least 13 battles including Badr, Uhud, Abawa, and Soweeq, he left Ibn Umm Maktoom in charge (3). During the battles of Hunain and Kheibar and his journey to Mecca, Abu Rahm was left in charge in Medina (4).

Considering the examples above, one could ask: how is it possible that the Prophet (PBUH) would leave someone in charge during the battle of Khandaq, which is near Medinah, but not leave someone in charge after his death? Not appointing a clear successor and guide after himself for the Muslims does not appear conventional as the Prophet (PBUH) was undoubtedly more perceptive than his companions, who discussed and appointed successors.

An alternative narrative and explanation comes from the event of Ghadir (5).

(40 Questions Regarding Caliphate and Imamat by Dr. Sayyed Mohammad Qazwini)

References:
1- Sahih Muslim, vol. 3, p.1455 (H. 1823); Musnad Ahmad, vol. 1, p.415 (H. 322);
2- Tarikh al-Tabari, vol. 5, p.304
3- Oun al-Ma’boud, vol. 8, p. 106
4- Al-Tanbih wa Al-Ishraf, pp. 211- 235
5- https://roshd.com/en/the-event-of-ghadir-and-its-importance