The formation of chlorinated by-products occurs during the water chlorination process. Chlorine, a common disinfectant, reacts with naturally occurring organic matter such as decaying vegetation in the water. This reaction leads to the formation of by-products like chloroform and other THMs. The process is influenced by factors including the concentration of chlorine, the amount and type of organic matter, water temperature, and pH levels.