On the molecular mechanisms driving pain perception and emergent collective behaviors