Allah says, "We did not send you, [Oh Muhammad ﷺ] except as a mercy to all the worlds" (Qur'an, 21:107).
Abu Bakr Muhammad ibn Tahir said in explanation of this Ayat,
"Allah imbued Muhammad ﷺ with mercy, so that his very being was mercy and all his qualities and attributes were mercy to all creatures. Whoever is touched by any aspect of his mercy is saved in both worlds from every hateful thing and obtains everything he loves. Do you not see that Allah says, 'We did not send you except as a mercy to all the worlds.'? His life was mercy and his death was mercy. As the Prophet ﷺ himself said, 'My life is a blessing for you and my death is a blessing for you'. (From al-Harith ibn Abi Usama in Al-Bazzar with a sound Isnad/chain).
The Prophet ﷺ also said,
'When Allah desires mercy for a community, He takes its Prophet ﷺ to Him before them and He makes him one who goes ahead to prepare the way for them'." - Muslim.
Extract from 'Muhammad, Messenger of Allah, Ash-Shifa of Qadi 'Iyad', translated by Aisha Abdar-Rahman Bewley; Madina Press 2011, pg 5 ©