Jellyfish use their sting to capture prey and act as a defence mechanism. When their tentacles encounter a human or other sort of prey they reach out and fire out harpoon-like structures containing a neurotoxic venom. It will paralyse their prey but in the case of us lowly humans it will just really hurt.