I agree with this but would like to add that the body will burn fat AND muscle for energy in some unknown ratio that probably varies by person. If you workout/lift weights and eat higher levels of protein than the standard American diet, then that shifts the ratio more towards burning fat and sparing muscle. You definitely cannot out-exercise a bad diet, but you’ll never get a desirable physique with diet alone.
Edited to add: I believe the body doesn’t like long periods of deficit calories. The max duration is likely dependent on body composition, but roughly 6+months of eating at a deficit is going to have a negative effect on anyone’s body’s ability to do things. Regardless of how much weight someone has to lose, they should take maintenance breaks to reset and recover those body systems.