MMS2 involves the use of calcium hypochlorite. When mixed with water it forms hypochlorous acid. This is the same compound that is formed when you add chlorine gas to water. When hypochlorous acid comes into contact with acid it releases chlorine gas.
The process of using calcium hypochlorite, sodium hypochlorite, and/or adding chlorine gas to water is called chlorination and is used in water treatment to disinfect drinking water.