When the leaders of Mecca's other clans decided that Muhammad's preaching against their gods had to be stopped, the obstacle in their way was not Muhammad himself but his uncle. Abu Talib had become head of Banu Hashim on his father Abd al-Muttalib's death, and Arabian custom placed every member of a clan, believer or not, under that chief's protection. Abu Talib never accepted his nephew's message, by the account Sunni biographers preserve, but he refused every demand that he withdraw his protection, and a chief's protection in pre-Islamic Mecca was a fact other clans had to respect or answer for.
The pressure escalated into a formal boycott. A document was hung in the Kaaba forbidding any Meccan from trading with, marrying into, or speaking to Banu Hashim until they surrendered Muhammad. For roughly three years the clan, Muslim and non-Muslim members together, was confined to a narrow valley the biographers call the shi'b of Abu Talib, living on what could be smuggled past the boycott by sympathetic outsiders. Abu Talib did not need to share his nephew's faith to see what handing him over would mean for a chief's standing, and the account credits him with holding the clan together through the confinement.
The boycott ended when, per the same tradition, the document in the Kaaba was found eaten by insects down to its opening formula, and the confinement lapsed. Abu Talib died not long after, the same year as Khadijah, close enough that biography names it the Year of Sorrow: the two who had done most to shield Muhammad, one through wealth and belief, the other through clan authority, were both gone within months, just before the Hijra made a different protection possible.