Just a final point about both the differences and similarities between the former South African and current Afghan situations -
The sporting ban on South Africa arose not because of disgust for domestic South African politics, or because of concern for oppressed people inside South Africa. The South African government made it abundantly clear that Black and minority members of touring teams would not be welcomed in South Africa, and would either be denied entry entirely, or expected to abide by SA's Apartheid laws whilst in the country, so they'd essentially end up being quartered separately from their white teammates, end up eating and travelling separately from their white teammates, using separate bathroom facilities and so on.
Obviously this was completely unacceptable to nations with multi-racial teams and those comprised entirely of players who would have been subject to the Apartheid laws, hence why SA was officially banned by many governing bodies. At no point were actual South African players prevented from plying their trade outside the country itself, because it was also recognised that individual South African sportsmen did not represent the Apartheid government, just as the Afghan cricket team does not represent the Taliban any more than the English team represents the Labour Party.
The Afghan team does not train or play fixtures inside Afghanistan, and some of the players have in the past made a point of reiterating that they play in order to represent the people of Afghanistan, not the Afghan government. No foreign teams travel to play inside Afghanistan, so to that effect, there is some similarity with Apartheid SA, but the reasons the ICC does not schedule fixtures inside Afghanistan are the same reasons they have previously scheduled Pakistan fixtures in the UAE; security concerns, and nothing to do with Pakistani domestic policy.
So in essence, the biggest difference is purely that international governing bodies had the gumption to outright ban SA national teams from participating, meaning that not only did touring teams not have to travel to SA, but they never had to "boycott" anything because SA teams did not participate in International tournaments, even though individual SA sportsmen did continue to play outside SA. This isn't a case of "why did we boycott SA and not Afghanistan" when the "we" in question is individual national teams, because individual national teams were never put in that position thanks to the governing bodies pre-empting that with blanket bans on SA teams.
The reason we still have Afghanistan participating in International tournaments when SA did not is purely and simply down to the ICC not considering domestic politics a reason for blanket bans, and yet this is still consistent with the historic ban on SA because that was not about South Africa's treatment of it's own citizens either, it was about how the SA government proposed to treat visiting sportsmen.