Most specialties are either surgical or medical specialties. Surgical specialties include general surgery, neurosurgery, thoracic surgery, etc. Medical specialties are everything else, like internal medicine, psychiatry, dermatology, etc. Some specialties like family medicine and emerg have a mix of both surgery and medicine. Surgical residencies are known as brutal 5-6 year experiences because of the long hours as well as the busy and frequent nights on call. These residencies are intense, in part, because surgery is a challenging skill for residents to develop.
Learning surgery from a book is much more difficult than learning medicine from a book. Both are best learned and remembered in the context of real patients (i.e. I am more likely to remember how to treat sepsis if I learn about it while managing a septic patient rather than only reading about it in a text book), which is the argument for why we need a residency after we complete medical school. However, if context isn't available, it is much easier to learn medicine form a text book. In fact, I think it is almost impossible to truly learn surgery without practicing it on an actual patient under the watchful eye of an attending.
Learning a hands on technical skill is a new challenge for most residents. Excelling in academics from grade school through undergrad and into medical school has made most residents very proficient at learning theory from a book. However, on average, we are much, much slower at picking up practical hands-on work.
Thus, a surgical education is significantly more resource intensive than a medical education. The limiting factor in the training of a future surgeon is most definitely operating room time. There is a surplus of patients that need surgery. There is a surplus of medical students who want to become surgeons. The resource that is scarce is operating time. With limited operating rooms, you can only hire a limited number of surgeons. A surgeon can only really teach one resident how to perform one type of surgery at any given time.
If a hospital has eight surgical residents, but only four operating rooms where surgeries are occurring on a given day. Then only half of the residents will be in the operating room learning how to perform surgery. Since surgery is already difficult to learn, the fact that they are not in the operating room every single day slows their education even more. Thus, they need to work long hours and have frequent overnight call shifts to maximize their opportunities to learn their trade.
Surgical residents would have a much better and more balanced experience if they were able to always be the first assist learning directly from a fully trained surgeon every day. Unfortunately, this is not an economically feasible possibility. This is particularly unfortunate because I think the lifestyle of a surgical resident scares away many talented medical students who may have the potential to become great surgeons.
Of course, in Canada, we currently have a surplus of surgeons graduating every year, so I doubt there is sufficient motivation to address this problem in the near future... Plus, most surgeons wear the challenging lifestyle of their residency as a badge of honour.