What looked like a sudden uprising was the culmination of civic defiance, underground networks and a widening gap between the rulers and the ruled.