Harmful algal blooms (HABs) characterized by a large concentration of toxic species appear rather rarely, but have a severe impact on the whole ecosystem. To study on possible trigger mechanisms for the emergence of HABs, we consider a nutrient-phytoplankton-zooplankton model to find the conditions under which a toxic phytoplankton species is able to form a bloom by winning the competition against its nontoxic competitor. The basic mechanism is related to the excitability of the system, i.e., the ability to develop a large response on certain perturbations. In a large class of models, a HAB results from a combined effect of nutrient enrichment and selective predation on different phytoplankton populations by zooplankton. We show that the severity of HAB is controlled by nutrient enrichment and zooplankton abundance, while the frequency of its occurrence depends on the strength of selectivity of predation. Thereby the intricate interplay between excitability, competition, and selective grazing pressure builds the backbone of the mechanism of the emergence of HABs.