We propose a general scenario to analyze social and economic changes in modern environments. We illustrate the ideas with a model that incorporating the main trends is simple enough to extract analytical results and, at the same time, sufficiently complex to display a rich dynamic behavior. Our study shows that there exists a macroscopic observable that is maximized in a regime where the system is critical, in the sense that the distribution of events follow power-laws. Computer simulations show that, in addition, the system always self-organizes to achieve the optimal performance in the stationary state.