Water is made of molecules. The molecules in water, like in all substances, are constantly moving around – this means that they have kinetic energy. Molecules with more kinetic energy move around faster than molecules with less kinetic energy.
Kinetic energy is related to temperature. The molecules in a glass of warm water have more kinetic energy (they move faster – see Racing Molecules) than the molecules in a glass of cold water. The temperature of a substance is the average* amount of kinetic energy its molecules have.
How does your thermometer measure the average kinetic energy of its water molecules?
Your thermometer doesn't measure energy; it actually measures volume. When a liquid is hot the molecules move around faster and bump into each other and the walls of the container more often and harder than slower moving molecules do. One result of this is that a hot liquid will expand in direct proportion to its temperature. The easiest way for the water in your bottle to expand is for some of it to move up in the straw.
When the water cools down, the liquid will contract and the water level will go down. Since the volume change is directly related to the temperature in both cases, your thermometer can tell you the temperature change by measuring the volume change!
The volume of liquid in an expansion thermometer depends on the temperature of the liquid. If two thermometers start out at the same temperature and then one is put in a hot environment and one in a cold, their volumes will change. A scale on the side of a thermometer shows how volume is related to temperature.