This has been my experience with teaching math and CS.
The biggest causes of failure is not identifying and teaching prerequisite skills.
The key point is prerequisite. Many times the skills needed to pass a math or CS class are not part of that class's curriculum.
Students who have encountered the building blocks already tend to do well, students who have not, tend to fail - no matter how much the class goes over the material in this class - because the problem lies before that material.