Here's how it works: the space between the inner and outer flask wall is evacuated, creating a vacuum (well, a partial vacuum anyway...). In order for heat transfer to take place from the outside world into your cold drink, or from your hot drink to the outside world, it needs nearby molecules to excite. If there aren't many molecules nearby, as is the case in a vacuum, the heat's energy can't easily be passed along, so your drink stays close to the temperature it was when you put it into the flask for a really long time. 

Simply stated, vacuums make great thermal insulation!