A thermos keeps cold things cold in the same way. It doesn't contain some kind of cooling device. The same vacuum that keeps hot things hot keeps cold things cold. Heat that might otherwise transfer to the cod contents of the thermos is prevented from reaching it because of the vacuum between the thermos walls.