To understand how burnout arises, imagine a young chef. At the restaurant where she works, Bistro Med, older chefs are retiring faster than new ones can be trained, and the customer base is growing, which means she has to cook more food in less time without compromising quality. This tall order is made taller by various ancillary tasks on her plate: bussing tables, washing dishes, coordinating with other chefs so orders aren’t missed, even calling the credit-card company when cards get declined.

Then the owners announce that to get paid for her work, this chef must document everything she cooks in an electronic record. The requirement sounds reasonable at first but proves to be a hassle of bewildering proportions. She can practically make eggs Benedict in her sleep, but enter “egg” into the computer system? Good luck. There are separate entries for white and brown eggs; egg whites, yolks, or both; cage-free and non-cage-free; small, medium, large, and jumbo. To log every ingredient, she ends up spending more time documenting her preparation than actually preparing the dish. And all the while, the owners are pressuring her to produce more and produce faster.

It wouldn’t be surprising if, at some point, the chef decided to quit. Or maybe she doesn’t quit—after all, she spent all those years in training—but her declining morale inevitably affects the quality of her work.

In medicine, burned-out doctors are more likely to make medical errors, work less efficiently, and refer their patients to other providers, increasing the overall complexity (and with it, the cost) of care. They’re also at high risk of attrition: A survey of nearly 7,000 U.S. physicians, published last year in the Mayo Clinic Proceedings, reported that one in 50 planned to leave medicine altogether in the next two years, while one in five planned to reduce clinical hours over the next year. Physicians who self-identified as burned out were more likely to follow through on their plans to quit.

What makes the burnout crisis especially serious is that it is hitting us right as the gap between the supply and demand for health care is widening: A quarter of U.S. physicians are expected to retire over the next decade, while the number of older Americans, who tend to need more health care, is expected to double by 2040. While it might be tempting to point to the historically competitive rates of medical-school admissions as proof that the talent pipeline for physicians won’t run dry, there is no guarantee. Last year, for the first time in at least a decade, the volume of medical school applications dropped—by nearly 14,000, according to data from the Association of American Medical Colleges. By the association’s projections, we may be short 100,000 physicians or more by 2030.

Some are trying to address the projected deficiency by increasing the number of practicing doctors. The Resident Physician Shortage Reduction Act, legislation introduced last year in Congress, would add 15,000 residency spots over a five-year period. Certain medical schools have reduced their duration, and some residency programs are offering opportunities for earlier specialization, effectively putting trainees to work sooner. But these efforts are unlikely to be sufficient. A second strategy becomes vital: namely, improving the workflow of medicine so that physicians are empowered to do their job well and derive satisfaction from it.