An empty bottle is never really, truly 'empty'. This is not optimism, it's a scientific fact. When a bottle isn't full of liquid, it's full of air. Emptying a bottle full of hot water leaves you with a bottle full of hot air.
Here's another scientific fact: air expands when it gets hot and shrinks when it cools down. This phenomenon is called thermal expansion and it's what causes warm air to rise and cool air to descend. Because its volume increases, the density of air decreases as it gets warmer and being less dense is what causes it to float on cooler, denser air.
When air is trapped inside a rigid and airtight vessel, however, its volume cannot increase. Heat an airtight vessel and instead of expanding, the air pressure inside goes up. Cool an airtight vessel and the pressure goes down.
Seal a hot bottle with a solid rubber stopper and no more air can enter so the pressure inside drops as the air cools down, producing what physicists call a partial vacuum. The pressure inside the bottle will remain lower than the air pressure outside until you remove the solid stopper, allowing air to rush in until the pressures are equal.
The straw provides a more entertaining way for the pressure inside and outside the bottle to equalise. As the warm air inside cools down, the falling pressure is immediately equalised by the water rising into the straw. The higher pressure outside the bottle forces the water up, which reduces the volume of air inside, which equalises the pressure. But the fountain really gets going when the cold water touches the glass. That's because it cools the bottle down a bit faster, which causes the air pressure inside to fall a bit faster, which in turn causes even more cold water to flow in even faster.
When the air temperature inside the bottle has cooled down sufficiently, the pressure inside stops falling and the fountain stops working.
The same phenomenon causes some refrigerator doors to become incredibly difficult to open again just after you've removed something or stared at the contents wondering what to eat. While the door is open, some of the cold air inside pours out onto the floor and warm rushes into the fridge to replace it. As soon as you close the door, the warm air trapped inside cools down causing the pressure to fall. Try opening the door soon after and it feels like the guardian angel looking after your waistline is trying to stop you. It's actually just the external air pressure pushing against the door. Leave it for a few minutes and the pressure inside will return to normal and the door will return to its more cooperative state. No guardian angels involved.
Some people call this fridge door effect 'suction' but whatever you do, don't say that in a room full of physicists. There'll be gaps of horror, the music will stop playing and the physicists will be staring at you like a pack of trembling zombies ready to pounce and feast on your brains. If you do find yourself in this predicament, bow your head and start edging towards the door chanting "vacuums don't suck, vacuums don't suck," apologetically, and then run for your life. Alternatively, ask them to explain the healing power of crystals and watch them run for the door.