I can't read NYT stuff (they want you to register) but do you mean the palolo worm?
It isn't "when threatened". They have an amazing strategy for reproducing while minimizing their risk of being eaten. They live on the seabed, and on one night of the year (first full moon in October, I think) they detach their genitals, which float up to the surface in billions all over the Pacific, glowing and copulating autonomously. Polynesians scoop up the genitals and eat them. Apparently they taste nondescriptly fishy.
You have to wonder what sort of lovesongs humans would have produced if we reproduced that way. (Or, perhaps, if our genitals glowed in the dark).