Changing one variable at a time while controlling others is a key aspect of scientific experimentation and is a central component of STEM curricula. However, children struggle to learn and implement this strategy. Why do children's intuitions about how best to intervene on a causal system conflict with accepted scientific practices? Interestingly, mathematical analyses have shown that controlling variables is not always the most efficient learning strategy, and that its effectiveness depends crucially on the "causal sparsity" of the problem, i.e. how many variables are likely to impact the outcome. We show that children as young as seven are sensitive to the causal sparsity of an unfamiliar causal system and use this information to tailor their testing strategies. Our findings suggest that the education literature, claiming that school children are unable to learn and master the control variables strategy, may have undersold their causal learning skills. Our analyses also help to clarify under what conditions controlling variables is actually a worthwhile approach to scientific inquiry, a fact that might come as a surprise to even professional scientists.