Hats Question: Confusion Over Its Formulation
It's called meta information. Basically, it boils down to “I know that you know, what I know. But do you know that?”.
So if there is only one red hat and the intel about red hat was not given. I am looking at the person with red hat and think myself “I know that there is a red hat, but I don't know if the person in red hat knows about it”. With two hats, the chain of thought is a step longer: “I don't know if person in red hat #1
knows that person in red hat #2
knows that there is a red hat”.
With intel that not only everyone hears, but also everyone hears that everyone hears and so on (so called common knowledge), this ladder of meta-information can never end, so eventually everyone will guess their red hat. However, if everyone is given this intel secretly from everyone else, this no longer works.
P.S. There is an interesting speculation about meta-information and flirting/euphemisms. If man asks a woman to go home and listen to his collection of medieval music, they both understand that man suggests a night together. However, if a man asks woman directly, woman can be dis-pleasured and likely to say no. The idea is that meta-informational decay “I know that he suggests sex, but I am not sure if he knows that I know that” allows her to keep face and bail out if necessary (“I didn't know!”), whereas common knowledge (“Come with me for sexy time!”) doesn't leave room for that.
Given that there are several hats, they all see at least one red hat, and hence they all know that there is at least one red hat. We could thus say that there is mutual knowledge that there is at least one red hat.
Even more, if there are three red hats (or more), then it is also true that they all know that they all know that there is at least one red hat, since they all know that everyone can see at least one red hat. This we could call shared knowledge
Neither mutual not shared knowledge is the same as common or public knowledge though: Common knowledge is the kind of knowledge that can go any number of levels deep. For example, if it is common knowledege that there is at least one red hat, then $A$ knows that $B$ knows that $C$ knows that $D$ knows that there is at least one red hat.
Now, if in a public setting the people are told that there is at least one red hat, then that becomes common knowledge, because they don't just all hear it, but given that this was said in a public setting, they also all know that they all heard it, and they also know that they all know that they know that ... they heard it.
However, if they are not told that there is at least one red hat, then we no longer have such common knowledge: with three hats we have the mutual knowledge that there is at least one hat (because they all see at least two red hats), and there is also the shared knowledge that there is at least one red hat (since they all know of any other person that that person must be seeing at least one red hat), but there is no common knowledge that there is at least one red hat: indeed, with exactly three red hats, and with $A$, $B$, and $C$ being the three different people wearing a red hat, $A$ does not know that $B$ knows that $C$ knows that there is at least one red hat.
Why does $A$ not know this? Well, $A$ looks around, and sees two red hats: on $B$ and on $C$. So: $A$ knows that $B$ knows that there is at least one red hat, since $A$ knows that $B$ can see $C$'s red hat. Likewise, $A$ knows that $C$ knows that there is at least one red hat ($B$'s!). Also, given that $A$ has a red hat, $b$ knows that $C$ knows that there is at least one red hat ($A$'s!). But, $A$ does not know that $B$ knows that $C$ knows that there is one red hat, because $A$ thinks: "Well, I may not have a red hat, and if that is so, then $B$ would be seeing exactly one red hat ($C$'s!), and so $B$ will say "Well, if I don't have a red hat, then $C$ is not seeing any red hats at all, and so $C$ does not know that there is at least one red hat", and so $B$ does not know that $C$ knows that there is at least one red hat". Again: $C$ of course know that there is at least one red hat, and $A$ knows that $C$ knows that there is at least one red hat, and $B$ knows that $C$ knows there is at least one red, but $A$ does not know that $B$ knows this about $C$.
Now, why is this important? Well, as you say, $A$ knowing that $B$ knows that $C$ knows that there is at least one red hat forms the very 'basis' of the reasoning: if no one raised their hand the first two times, then $A$ says:
"Now, wait a minute, I know that $B$ knows that $C$ knows there is at least one red hat, and so if I don't have a red hat, then given that the first time around no one raised their hand, $B$ should have realized to have a red hat, for $B$ should have thought "Well, I know that $C$ knows there is at least one red hat, and so if I don't have a red hat, then $c$ is the only one with a red hat, and so $C$ should have raised their hand the first time, but $C$ did not, and so I in fact do have a red hat" ... but $B$ did not raise their hand the second time around, and so I ($A$) in fact do have a red hat!"
So you see how important it is for $A$ to know that $B$ knows that $C$ knows that there is at least one red hat: $A$ uses that bit of information right at the very start. But if no one would have made a public announcement that there is at least one red hat, then, as explained above, $A$ would not know that $B$ knows that $C$ knows that there is at least one red hat.
By the way: it is extremely hard to ever get common knowledge in the real world if you think about it: I would have to know that you were paying attention when the public announcement was made ... and that you weren't deaf, and that you know of all the others that they aren't deaf and were actually paying attention, and we all need to know this of each other .. and know that .. and know that. In other words, there already needs to be a lot of public knowledge about people paying attention and not being deaf in order for the public announcement to become common knowledge about whatever the announcement was about. Moreover, if you know want to exploit this kind of common knowledge in any kind of reasoning, we also need to have the common knowledge that we are all capable of this kind of reasoning any number of levels deep (or whatever number of levels is needed for the issue at hand) ... but how would I know this? In fact, in real life I would suspect most people to get completely bewildered in their logical thinking if it goes any deeper than 2 levels. So, if I were to play this in real life with a real group of people, I wouldn't be sure at all that I would have a red hat if I see only two red hats around me and no one raised their hand any of the first two times.