Hiya's...
Covems...
...there's a little genie that lives between the glass liner and the outside wall of thermos bottle. When something is poured into the thermos the genie senses its temperature and moves a hidden switch so the thermos bottle reacts accordingly.
If you break the glass liner, the genie escapes. That is why once the glass liner is broken, the thermos bottle no longer functions properly.
I hope my explaination helps you to understand how it knows.
Thanks for letting me share,
Pafe
P.S. Psssst... (notice the genie's shoes... they're boudoir shoes)