How did the Taliban gain power originally in the 1800s?

The "Taliban" did not exist in the 1800's.