Well according to the sequel movie, Frosty brought his gf to life with the power of love/a gift of love, and in turn she brought him to life with the power of love/gift of love after his hat was knocked off.
So I would assume the first hat was a gift of love as well.