Predicting products of chemical equations?
One would not "know" what the products of the reaction are, a priori. As mentioned by @IvanNerenten, the way you know is by studying chemistry. In fact, the reaction is different if you use cold NaOH vs hot NaOH. The reaction as written is with cold NaOH and is a disproportionation reaction.This is where the chlorine is both oxidized and reduced in the same reaction.