I've begun to self-study String Theory from Polchinski and Becker, Becker and Schwarz. I don't see why the fact that the Polyakov action is invariant under Weyl transformations is related to the tracelessness of the energy-momentum tensor. I can follow the argument in BBS with gauge freedom just fine, but then they mention that this is related to Weyl invariance. On the other hand, Polchinski simply says
The invariance of $S_\text{P}$ under arbitrary Weyl transformations further implies that $$\gamma_{ab}\frac{\delta}{\delta\gamma_{ab}}S_\text{P}=0\implies T_a^{\;a}=0$$
(Here $\gamma_{ab}$ is the worldsheet metric.)
How does this follow from Weyl invariance?