Honeybees use alarm pheromone to recruit bees into mass stinging of large predators. This pheromone is carried on the stinger, hence its concentration builds up during the attack. We investigate how bees react to different pheromone concentrations, and how this evolved response-pattern leads to better coordination at the group level. We present an experimental dose-response curve to the alarm pheromone and apply Projective Simulation to model bees as artificial learning agents that rely on the pheromone concentration to decide whether to sting. Individuals are rewarded based on the collective performance, emulating natural selection in these complex societies. We are able to identify the selection pressures that shaped the observed response-pattern.