Watch the last set again. Novak was absolutely dead about halfway through that set. Could barely move after Murray moved 4-2 up.
Djokovic was quoted, as I recall, as saying that he knew Andy had won at 4-2 up in the fifth, so he must surely have known he didn't have in him to fight back. The problem is that he's looked half dead like that before, so Andy did well to focus on what he was doing, not allowing himself to get distracted by Djokovic looking like he was about to sieze up down the other end.
I think it was a combination of things that helped Andy. He kept his head in the fifth, that has to have helped him.
I still feel that the way Andy moved Novak around early on in the match laid the groundwork for what came later. If you watch the first couple of sets, Andy didn't seem to let Djokovic settle much, he was constantly making him run. He's always known that if you can take away Djokovic's legs you can get him, and he did it beautifully at the USO.
Djokovic had to play catch up in the second set too. Andy could have filleted him there, but Djokovic came back. He was all right doing it then, but I do think that overturning that two set lead to draw level again, took a lot a lot out of Djokovic, physically, but mentally too.
Ultimately I think Andy dug deeper when he needed to. I think he found something in himself that night that he might not have realised was there before. I know it's the most obvious thing to mention the bathroom break, but I do think that was big for Andy, to be able to tell himself like that that he wasn't going to let it (losing a major final) happen again, and give himself that talking to when he needed it. I think that bodes well for the future.