The answers about the population not having the will to fight miss the point completely and are irrelevant and propagate racist views. Afghanistan has a pre-existing system of tribal relationships that are constantly dynamic. The Taliban are effective because they negotiated a path with the pre-existing power structures. The central government is only one player of many.
CBC wrote a brief article on this recently: https://www.cbc.ca/news/politics/taliban-revival-aug13-1.613...