"In my experience (about 2 decades ago) in a group of 20-30 students only 2 or 3 are able and willing to do homework. Most students just find someone else and copy from them. The real learning happens when preparing for a big exam.
And to pass an exam students have to prepare for the exam. Homework will only help there if it is similar to the exam."
That's not learning really. I can confidently say that because I was the one who unfortunately regressed to this during the uni, and the same story with my peers. One simply can't prepare to the multiple exams sufficiently in a few weeks time (or less). So the only path left is hysterical rote memorization of as much material as possible to squeeze in at a passing grade, and then immediately forget all of the materials in a few months time. Burst of "learning" twice a year for a short time doesn't translate into real learning.
And that's for some simple courses during first few years. Specialist courses later in the program sometimes are impossible to rush "learn". When I tried to pull this off for Probability Theory course, I've failed spectacularly to get even lowest passing mark at first try. And others failed the same way.