When you removed the cards from one set of bottles, the hot water stayed on top and the cold water stayed on the bottom, with the colors staying pretty much the same. In the other set, however, something very different happened. The hot water rose, and the cold water sank. As this motion occurred, the colors mixed. This happened because of differences in density, which is defined by the amount of material in a given volume.
Everything is made of molecules. Hot molecules move more than cold molecules, and things that are hot typically take up more space than the same things when they are cold. This means it takes fewer hot-water molecules to fill a bottle than cold-water molecules. Hot water is therefore less dense than cold water.
Gravity can separate fluids by their density. Because the cold water has more mass per unit volume than hot water, the force of gravity on a given amount of cold water is larger than that on the same amount of hot water. This forces the cold water downward and causes the hot water to be pushed or lifted upward. This motion of fluids is called convection. In the set of bottles where the hot water was above the cold water, the cold water was already on the bottom, so there was no convection.