During Winter Bash, users can earn hats. But sometimes it seems that a hat was awarded even though its requirements weren't (yet) met, or vice versa.
What could the reason for this be?
Here are some reasons why a hat may or may not have been awarded even though it seems that shouldn't or should have been the case. The example hats given here are completely fictional but totally realistic.
Unless the requirement mentions a specific timezone, hats that are date-based are often awarded for 14 hours before and 12 hours after the specified date in UTC, to accommodate people everywhere in the world. This means you can earn such a hat even though for you it's not even that day yet.
Example: The hat Living in a Box is awarded for voting to close a question on December 26th. To earn this hat, you have to cast a close vote between 12/25 at 10:00 UTC and 12/27 at 12:00 UTC.
To prevent people from posting nonsense just to earn a hat, most hats that require creating content, especially questions and answers, have some requirements that may not be mentioned in the hat description. Generally this involves questions/answers having a positive score (i.e. getting at least one upvote), not being closed/deleted, etc. If the hat has an additional date requirement, it is okay if the upvote comes in after the time is already over, as long as the content was created during the time.
Example: The hat I gave you my heart has the requirement "post an answer while listening to Wham's Last Christmas". This requirement doesn't explicitly mention that the answer has to have a score of at least one. It's okay if the answer is only upvoted after the song is over, as long as it was posted while it was playing.
In some cases, there may be an unmentioned requirement for certain things to be outside your control, lest it be too easy to get a hat. In particular this is often the case for hats involving accepted answers where self-answers are excluded.
Example: The hat We Built This City is awarded for posting an accepted answer that includes references to seven different 80s pop songs. Not explicitly mentioned in the description is the fact that it doesn't count if the answer is on your own question (and thus you could self-accept it).
Sometimes a user fulfills the requirements and thus a hat is awarded, but at some later point the requirements are no longer met, e.g. because a post was downvoted again or even because there was a bug in the hat implementation. In such a case, the user can (usually) keep their hat.
Example: The hat Major Tom (this one, not this one) was awarded during the Summer Bash of 2006 for setting your user name to the name of a planet in our solar system. Users who called themselves "Pluto" before August 24th were allowed to keep the hat.
That's why some database queries that are used to find deserving hat owners may also return the Community user. And because it's all about fun, we don't filter this user out (like we do e.g. when awarding badges), and so she can in fact earn hats. The Community user's hat on a site can be changed by any moderator on that site.
Example: The hat Legal Alien is awarded for replacing the word "color" with "colour" in five different posts. Suggested edits made by anonymous users are, once accepted, attributed to the Community user. Thus when five anonymous edits include this word replacement, the Community user earns the Legal Alien.
Most hats are awarded for things you do on the main site, but there are a few that are awarded for performing an action on the site's meta. Their requirement generally includes the words "on meta". You still earn these hats on the main site, but you earn them for doing something on its child meta.
Meta Stack Exchange is a bit special in this regard, because it's both a main site and a meta site. For the purposes of Winter Bash, Meta Stack Exchange counts as its own child meta.
Example: The hat Danger Zone is awarded for performing a review. The hat Rick Roll is awarded for voting to reopen a question on meta that has already been closed and reopened at least three times. On Meta Stack Exchange, and only here, it is possible to earn both Rick Roll and Danger Zone for a single action.