In a well designed psychology experiment an investigator will randomly assign subjects to two or more groups and except for differences in the experimental procedure applied to each group, the groups will be treated exactly alike. Under these circumstances any differences between the groups that are statistically significant are attributed to differences in the treatment conditions. This, of course assumes that except for the various treatment conditions the groups were, in fact, treated exactly alike.
Unfortunately, however, it is always possible that despite an experimenter's best intentions there were some unsuspected systematic differences in the way the groups were treated in addition to the intended treatment conditions. Statisticians describe systematic differences of this sort as confounding factors or confounding variables.
If, for example, subjects in one group are simultaniously tested in a room with the heat set at 70 degrees whereas subjects in another group are simultaniously tested in a nearby identically appointed room with the heat set at 60 degrees, the obtained differences in performance could be attributed to any of three factors. It could be due to the random assignment of subjects (i.e. to chance). It could be due to the different temperatures in the two rooms. It could, however, be due to some confounding factor such as differences in ambient illumination that result from unnoticed differences in the orientation of each room with respect to the sun. In any experiment an appropriate statistical test can help in the decision as to whether or not to attribute the results to chance, but only the most careful analysis of the actual conditions of the experiment can suggest whether or not the results might be due to a confounding factor.