Violent extremist groups have emerged on the cusp of great social, economic and political changes. What can we learn?