One sign of really good fresh well-roasted coffee beans is foam. When you pour hot water into the French press, it foams, often forming a head up to 2" high. And when you use an espresso machine, you get a nice foam called "crema".
However, if you pour hot water into a teapot and see foam, that's a sign of terrible tea and you should throw it out.
Questions: what chemical reaction is taking place in each of the two cases (coffee and tea), and why does coffee get less foamy when it gets older whereas old tea gets more foamy?