The field of ecology has long recognized two types of competition: exploitative competition, which occurs indirectly through resource consumption, and interference competition, whereby one individual directly harms another. Here, we argue that these two forms of competition have played a dominant role in the evolution of bacterial regulatory networks. In particular, we argue that several of the major bacterial stress responses detect ecological competition by sensing nutrient limitation (exploitative competition) or direct cell damage (interference competition). We call this competition sensing: a physiological response that detects harm caused by other cells and that evolved, at least in part, for that purpose. A key prediction of our hypothesis is that bacteria will counter-attack when they sense ecological competition but not when they sense abiotic stress. In support of this hypothesis, we show that bacteriocins and antibiotics are frequently upregulated by stress responses to nutrient limitation and cell damage but very rarely upregulated by stress responses to heat or osmotic stress, which typically are not competition related. We argue that stress responses, in combination with the various mechanisms that sense secretions, enable bacteria to infer the presence of ecological competition and navigate the 'microbe-kill-microbe' world in which they live.