The Banu Bakr, allies of the Quraysh, had attacked the Khuza'a, who were allied to the Muslims, and the Treaty of Hudaybiyyah was close to collapse. With the approval of the Quraysh, Abu Sufyan travelled alone to Madinah to try to renegotiate it.
The reports differ on the order of his visits. Ibn Ishaq says he went first to the Prophet ﷺ, who gave him no response at all. Only then did he go to Abu Bakr, Umar ibn al-Khattab, and Ali ibn Abi Talib in turn. Ibn Sa'd says he visited Abu Bakr, Umar, and Ali first, and the Prophet ﷺ last. Sh. Yasir Qadhi leans toward Ibn Ishaq's version.
Abu Bakr, his friend from before Islam, told him plainly that he could not help. Umar, his former business partner, refused even more bluntly. Ali was his third cousin and his closest relative in Madinah. Ali heard him out, but told him that once the Prophet ﷺ had decided a matter, they would not try to change it. Abu Sufyan then turned to Fatima, who was there with her little son Hasan. He asked her to have the boy seek protection for him. Fatima replied that her son was too young to grant protection, and that no one could give protection against the Prophet ﷺ.
As a last resort, Ali advised Abu Sufyan to stand in the mosque and publicly ask for protection. Under Arab custom, any member of a tribe could grant protection, and Islam kept this rule for any Muslim, male or female, old or young. Abu Sufyan made the plea, but no one came forward, since the Prophet ﷺ himself had said nothing.
Before leaving Madinah, Abu Sufyan visited his daughter Umm Habiba, a wife of the Prophet ﷺ. He had not seen her in over 13 years, since she emigrated to Abyssinia. When he went to sit down, she quickly folded away the bedding. She told him it was the bed of the Prophet ﷺ, and that he, as an idolater, would not sit on it. Abu Sufyan returned to Makkah empty-handed. When he told the Quraysh that he had begged for protection in the mosque, they told him he had been made a fool of.