It's not just about motivation, it is just that your perceived ability to execute (going through the motions) and actual ability are completely at odds and you eventually lose all confidence in yourself to continue.
It's not motivation for the job, it's belief in your own abilities / capabilities that erodes your motivation.
E.g. I still could read the assignment, understand the problem, even estimate how long it could take the former me to complete. Then continue wasting time in front of the screen, sometimes dabbing here or there, at 1/20th or so of normal work pace. The confidence sure suffers badly, but really it was down to complete lack of will to do anything.
There was a grandsibling comment that you can actually force healthy person to dig ditches and do other menial labor no matter what. This is a problem well studied by prisons and armies of the world over millennia. Thing is, whipping isn't usually tried with burnt out devs, who knows it could have worked. It's not like your IQ drops 50 points or something. USSR and China had a fair experience of forced intellectual prison labor, and things were getting done.
In both cases the performance was similar. With earthworks I simply didn't give a damn about the job, so just pecked the ground unenthusiastically. With burnout it was as if petard went off, but instead of earbuzz you get numb to planning, focusing and executing. I actually felt bad about it, but doubt you'd see much behaviour difference from the outside.
So I'd wager the lack of motivation is a serious handicap in both cases. Sure, "anyone can dig a ditch" but I dare you try doing it for a day if you are not into it. Similarly I was already an experienced developer at the point of burnout, and the job at hand wasn't challenging at all.