OK, so yeah, that hair-trigger thing is called a cnidocil, and what it triggers is a load of calcium ions to surge into the main body of the cell. Then, thanks to the magic of osmotic pressure, water rushes into the cell from outside, turning the folded-in cell inside-out and propelling a tiny barb on a string into the offending organism at upwards of forty-thousand Gs. As you can imagine, these things don't come cheap: they're something of a pain to make, and so cnidarians (which, whaddaya know, are the things that have cnidocytes) also use chemoreceptors to detect whether or not they're dealing with a prey organism and then fire their cnidocytes in batches.
This is rather like a forward reconnaissance group determining that, yes, the enemy is here, and then a battery of artillery guns firing on the enemy position. Except that the forward-recon-group-slash-chemoreceptors are tasting the target to determine that they're the enemy. And the artillery-guns-slash-cnidocytes are hucking threaded needles full of poison really, really fast at the targets. Oh, and the gunners die after firing one shot. So it's really not like it at all, but now you should be picturing guys in camo licking their enemies, then a bunch of other guys in camo behind them hucking poisonous needles at the other side as they explode in death and organs (this may or may not be what I think of the army). Behold the power of imagery, and how I wield that power with something that might be like panache!
The point is that while we homo sapiens have refined the process a bit, jellyfish and anemones have been doing this shit for ages. Like, literally. Now I need to find something interesting that's not biology, before this turns into "Mother Nature Did it First: The Blog" while I'm not looking.