cant help with the painkillers but it must be similar to a thermos flask, ok i know it keeps stuff hot and it keeps stuff cold, but how does it know which is which?
I guess this question was tongue in cheek?
But if not here is the answer . .
A flask doesn't 'keep' things hot or cold but simply slows down the rate of change.
Temperature allways equalizes due to conduction.
If you put hot food on a cold plate the plate will warm up causing the food to cool down. leave them long enough and they will both be exactly the same temperature which due to the same process with the surrounding air will be at the room temperature.
All a flask does is prevent the conduction of heat by creating a gap using a vaccum of air to prevent the conduction of heat.
Of course they aren't perfect as the lid allows the conduction of heat and the vacuum space is also small allowing radiated heat to cross the gap.