The confounding variables could be a lot things here like the weather, temperature, soil, rainfall which might have caused a correlation between increasing herds and depleting silver sword plant. Here, environment(including all the factors above) is the confounding variable between goats and plant. The biologists might have kept goats and plant in different environment and observed how it helped goats thrive and eventually adapting to eat plants in turn depleting the plant's volume.
The following description of a statistical study is an excerpt from Understandable Statistics Concepts and Methods,...