It was first Aristotle who discovered what is now known as the Mpemba effect: that hot water actually freezes faster than cold water. Scientists have struggled to explain this for years, until recently.
We all know that "water" is made up of two hydrogen atoms and an oxygen atom, more accurately known as H20. Cold water is made up of short hydrogen bonds and long O-H covalent bonds, while the opposite is true for warm water. It is these hydrogen bonds that act weirdly and have drawn the attention of scientists.
Some strange, unexplainable facts about these hydrogen bonds:
1. Although they're generally weaker than covalent bonds, they are stronger than the "van der Waals" force that is the sum of all attractive forces between molecules.
2. Chemists have suspected for awhile now that it is these hydrogen bonds that give water some of its weirder properties, such as allowing its boiling point to be so much higher than other liquids of similar molecular make-up. The hydrogen bonds hold it together very well.
Anyway, though the hydrogen bonds bring water molecules into close proximity, the molecules are naturally repulsed by each other and as a result stretch away from each other and store energy, increasing heat.
When the molecules shrink again and lose their energy, they begin to cool quickly as a result. Voila! The Mpemba effect.
That was a simplified explanation from someone who hasn't touched Chemistry in two years, so I apologize if any of it is incorrect. Hope it gave you some insight, at least!
Thanks for reading. Until next time,