How does trihalomethane developes?

Can you answer this question?