Common Knowledge and the Red Hats Puzzle
Without the teacher, everyone knows that there is at least a red hat, but nobody knows that everyone knows - the fact is not common knowledge. 

With the introduction of the teacher, 


Girl 1 doesn't answer. Due to common knowledge, 2 and 3 can reason: "1 knows there is at least one red hat, and since she doesn't know her hat color, 2 and/or 3 must have a red hat.


Without the introduction of the teacher,


Girl 1 doesn't answer. Without common knowledge, there is nothing 2 and 3 can reason on top of their prior knowledge: 2 will keep knowing that 3 has a red hat, and 3 will keep knowing that 2 has a red hat. Nothing more.


In other words: Without the teacher, the set of knowledge is:


1: 2+3 have red hats
2: 1+3 have red hats
3: 1+2 have red hats


The teacher works as an injector of additional knowledge:


1: 2+3 both know that there is at least one red hat
2: 1+3 both know that there is at least one red hat
3: 1+2 both know that there is at least one red hat


And, common knowledge means that in the next level, everyone knows that everyone knows


1: 2+3 both know that I know that there is at least one red hat


etc, ad infinitum. This additional information is required to solve the puzzle.