There are so many phrases and sayings in the English language (And in other languages) that make absolutely no sense in any grammatical way and sometimes even logical ways. However, they still become a meaning to something.
The word "cool" is like this. It makes you wonder how a word that is essentially a description of temperature, can suddenly be chosen as a common word for a number of generations used to describe the interestingness or uniquity of something.