While there are thousands of "herbal teas", just "tea" refers to beverages made with the Camellia sinensis plant. See https://simple.m.wikipedia.org/wiki/Tea
If this effect is being observed in both coffee and tea, my guesses would be it's either caffeine, something with the roasting, possibly fermentation (but I'm not sure if all tea is fermented), something with fluid consumption, or something with the mental ritual of drinking mild stimulants.