The hypothesis that living systems can benefit from operating at the vicinity of critical points has gained momentum in recent years. Criticality may confer an optimal balance between too ordered and exceedingly noisy states. Here we present a model, based on information theory and statistical mechanics, illustrating how and why a community of agents aimed at understanding and communicating with each other converges to a globally coherent state in which all individuals are close to an internal critical state, i.e. at the borderline between order and disorder. We study—both analytically and computationally—the circumstances under which criticality is the best possible outcome of the dynamical process, confirming the convergence to critical points under very generic conditions. Finally, we analyze the effect of cooperation (agents trying to enhance not only their fitness, but also that of other individuals) and competition (agents trying to improve their own fitness and to diminish those of competitors) within our setting. The conclusion is that, while competition fosters criticality, cooperation hinders it and can lead to more ordered or more disordered consensual outcomes.