Didn't Jobs bring in Sculley himself before getting ousted? It's not as though he was removed for any particular disaster, it was a coup.
He returned and continued doing exactly what he had done before. Investing tons of resources into new products that have cutting edge features bundled into an aesthetic package.
Apple was a disaster, riding on the coattails of the Apple II, prior to the ousting of Jobs. The Apple III was both an engineering and market failure. The Lisa was an engineering and market failure. The future of the Macintosh was by no means guaranteed. Whether he was the cause of the problems within Apple or a symptom of it is open for debate, but he certainly wasn't helping matters. Just consider how the Macintosh the world grew to love came to be.
I don't know the story of Jobs well enough to pinpoint what had changed over the intervening years, but something clearly did change. He had and maintained the confidence of the company. He was able to restore confidence of the consumer. There was a clear succession plan when he passed away, avoiding the turmoil that Apple saw after his ousting in the 1980's. This was not the same man, even if he maintained his abrasive edge.
The thing that saved Apple was the retirement of Classic Mac OS in favor of the NeXT OS (OS X and now MacOS).
In the early 2000s, developers were building for the Internet and there were only two options for hosting: Windows NT and Solaris. The licensing for both was prohibitive (and just annoying) and so Linux/FreeBSD started getting traction on the server side. FreeBSD didn't have the hardware adoption so faded (but is still loved). Linux had enough hardware support to run serious servers but the desktop never was usable (the year of the Linux desktop!).
Having OS X being a UNIX-variant was 'close enough' to develop on Mac (a very usable desktop) and deploy on Linux.
Then, Windows released Vista which was so broken that developers simply had to move to Mac in order to be able to function.
That progression is why Mac went from almost dying to being the most valuable company on Earth.
"The heaviness of being successful was replaced by the lightness of being a beginner again, less sure about everything. It freed me to enter one of the most creative periods of my life." - Steve Jobs on being fired from Apple.
I'd assume also a godlike human being like Steve Jobs evolved within the 12 years he was gone from Apple, so I doubt the person who returned was the same as the one that left.
While I would not compare any human to a god, Steve jobs is among entrepreneurs the most obvious and justifiable candidate to be worshipped. Under his leadership he converted a company that was relatively a small player in tech to the worlds most profitable company, flowing with more cash than the oil filled Saudi Aramco. Apple’s valuation has crossed the GDP of UK (lol), truly something phenomenal that this generation has got to witness.
He returned and continued doing exactly what he had done before. Investing tons of resources into new products that have cutting edge features bundled into an aesthetic package.