In the pot of tea the molecules would be moving faster than the tea in the cup.
So when the liquid heats up the molecules vibrate fast and it increases the difference between them. When the heat leaves a substance, the molecules vibrate slower and get closer.
Hope I Helped You!!! :-)
Have A Good Day!!!