What is the function of a nematocyst?

What is the function of a nematocyst?