On the complex interaction between collective learning and social dynamics