Thaqif had watched what happened at Mecca and had no intention of repeating it. The gates were shut before the army arrived, with stores for a year inside and archers on the parapet who could shoot further than the besiegers could answer.
This is the shape of a siege the Muslims had not fought before. Khaybar’s forts were reduced one by one because they were separate; Taʾif was a single walled town with a garrison that had no reason to come out.
The first camp was set too close and men were hit on the first day. The Prophet ﷺ moved it back out of bowshot, to the ground where the mosque at Taʾif was later built.