Most of us have heard about the treaty of al Hudaibiyyah, wherein the Prophet (peace and blessings be upon him) made an agreement with the Quraysh: in summary, the Muslims left from al-Madinah to Mekkah for the purpose of making an 'umrah in the 6th year of the Hijri calendar. However, the Quraysh opposed this. Delegations and representatives were exchanged between the two sides during the negotiations, and the final result was the treaty of al Hudaibiyyah.
One lesser known incident that took place during the events leading up to the treaty was when Allah's Messenger (peace and blessings be upon him) made a comparison of his situation to that of Abraha (the one who set out with an army to destroy the Kaba as is narrated in Surah al Fil). One reaction that might come to mind is: "How can you compare something that happened in the life of the Prophet to that of those who wished to destroy Islam?" Before getting to this point, what occurred was the following:
When the Messenger of Allah (peace and blessings be upon him) drew near to al-Hudaibiyyah, his camel, al-Qaswa, knelt down to the ground. The Companions (may Allah be pleased with them) who wanted it to get up so that they could reach Mekkah without delay, said, 'Without any justifiable reason, al-Qaswa has knelt down to the ground.' To which the Prophet (peace be upon him) responded, 'al-Qaswa did not kneel down without a good reason; That is not its character; instead, it was prevented from continuing onward by the One Who prevented the elephant.' Knowing that entry into Mekkah was not intended for them, the Prophet (peace be upon him) changed course and proceeded until he stopped to make camp at the furthest extreme of al Hudaubiyyah, at the well of Thamad.Following this many other beneficial events occurred, such as how the Prophet (peace and blessings be upon him) preformed a miracle, by the permission of Allah - that of water gushing from an empty well. Other events aside, the comparison between the situation of Abraha and his elephant to that of Prophet Muhammad (peace and blessings be upon him) and his camel is an interesting one, which we can benefit from.
First and foremost we can learn the sincerity of belief found in the best of examples of humankind, how the Prophet (peace be upon him) knew that everything happens according to the permission and Will of Allah. Furthermore, he (peace be upon him) took such an event and extrapolated direction and guidance from Allah - that their umrah was not destined to occur that year.
With regards to the comparison of himself to the situation of Abraha ibn Hajr explains that it is permissible, based on this and other events, to compare two people or two things even if they are completely different. And, in this case they are truly different: one being a Prophet receiving divine revelation and the other planning to destroy the Kaba. The comparison here is being made with regard to the act of being held back, not to status or belief.
Interestingly, the Prophet (peace and blessings be upon him) then decided, due to the events related above, that if the Quraysh were to request for help and/or an agreement by which the sanctity of the Kaba and Mekkah were preserved, he would agree - peace and blessings be upon him. And, this shows Muslims that it is encouraged to answer the call to do something good, even if the person inviting and calling is not a Muslim - and in this case the caller to an agreement was the worst enemy of Islam.
For additional details see: The Noble Life of the Prophet, p. 1495-1499.