In the pot of tea the molecules would be moving faster than the cup of tea.
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!!!