Trichlor is basically CYA with three chlorine molecules attached to the three nitrogen atoms of the CYA molecule (hence the tri- in trichlor).

In water the chlorine detaches and does its work, and you're left with just the CYA molecule.

That's the simple explanation.