Lack of education mixed with unemployment make a dangerous mixture. I am still studying this insurgency but many Taliban recruits in Swat were unemployed and searching for a job. Other reasons are the poor justice system. Taliban filled a vacuum that already existed. It takes years for cases to be resolved in our country.
Simple example. A case of a militant in 2009 I think. Forgot the name but the case appeared in an article. A landlord had built a mansion but refused to pay the workers who built it. Later some years as the Taliban rose to power that mansion in Swat was razed to the ground.
Another case. It appeared in an article too. A man was crying in the mosque in Peshawar. He was a poor peasant whose rightful money was taken by a powerful person who refused to pay up and threatened the peasant. Militants saw the peasant crying in the mosque and followed him to his home from the mosque. Asked him what was troubling him. He laid out his story. The militants threatened the landlord. Money came back to the man immediately. The man became one of the most vocal supporters of militancy in Peshawar.
So injustice, unemployment, intolerance, lack of education-all reasons for the problem. In FATA its tribal warfare too. For example it is assumed rather than fully known though, that 60% of the Taliban are Maseed tribesmen. I am not blaming the tribe. Many Mahsuds here like Fawad Mehsud and I used to know a guy names Shahmeer on twitter. All patriotic Pakistanis. But the Taliban clearly have taken control of jirgas of the maseeds-partly by killing tribal elders who once held authority. There was also a case in Bajaur like this which has a vibrant political culture. A jirga sentenced an army soldier and a woman to death for illicit relations.