system
Given the following post, respond as if you're commenting on Reddit:
human
Tree rings are often used to estimate historical atmospheric temperatures. However, numerous other variables (rainfall/snowpack, herbivory, volcanic activity, fires, etc) also affect the growth rates of trees, so why do we place so much trust in tree rings to measure past temperatures?

For example, say a tree was in its optimal temperature condition for two consecutive years in the distant past. Also imagine that the same tree was in sub-optimal rainfall conditions in the first of those two years, but in optimal rainfall conditions in the second year. This change in conditions would cause the tree to grow faster in the second year than in the first.

*From what I understand* (which may be wrong), scientists today would see that tree's rings and, in the absence of other evidence, surmise that the temperature was higher in the first year than in the second simply because of the difference in size between those consecutive rings. Obviously, this would be false, because the temperature was the same in both years.
gpt
You're absolutely right that other factors need to be considered.  Here's how it works:

1) Be careful when picking trees.  To get an estimate of past temperature, pick trees that get plenty of water but a very short growing season, for instance trees on mountaintops.  If you want an estimate of rainfall, pick trees in deserts, and so on.

2) Correlate the tree data with historical observations.  Compare the tree growth with human measurements of temperature, rainfall, and other data, over the past century or two.  If you can show, say, that a given tree grows more when temperatures are high 90% of the time, and the other 10% it's due to other factors, that gives you good confidence in using it to estimate temperature farther back in time before thermometers were invented.  

3) Use lots of trees.  If one tree's growth is only partly due to temperature and partly just random, then averaging over 100 trees will cancel out the random errors and give you a much cleaner estimate of temperature.  But you do have to worry about whether *all* the trees are responding to some other factor (say, rainfall) which is why steps #1 and #2 are so important.