Well, at least according to book
near the end, I recall Gandalf explaining where he'd been during all of the Mirkwood and reclaiming the Mountain stuff, and saying that he was dealing with a Necromancer (or maybe it was imprisoned in the Necromancer's dungeons?) and that he escaped and the Necromancer was defeated. So presumably this defeat at the hands of Gandalf/whoever helped him in there is what led to the change from humanoid necromancer form to giant flaming eye form.
Correct me on any details I got wrong, I haven't read The Hobbit for quite a while, and I may be misremembering some stuff. I really need to read that again...
Yeah, that's exactly what the book says, except that I believe it's also canon that he lost his shapechanging ability and so the eye thing would've been his form ever since he managed to regain form of any kind after the Ring was taken. In the novel, Sauron is never directly interacted with except through the Palantiri, which makes it less of an issue because there's no information to conflict with anything.
My money is on the Necromancer being the Witch-king, though. In the movie, I mean. Baseless speculation, but still.
Sauron did not lose his ability to shapeshift. After the Downfall of Numenor, he lost the ability to take
fair forms - but that's all he lost.
Sauron decidedly did have a humanoid form in the LotR book - several characters make reference to it. Gollum, for example, who was tortured by Sauron, notes that Sauron has only four fingers on one hand.
The whole flaming eye thing was artistic license on the part of PJ.
The Witch-King burial thing is also artistic license. He never died. After the fall of Angmar, Earnur and Glorfindel confronted him, but he fled and Glorfindel forbade pursuit. Glorfindel is the one who prophecies it would not be by the hand of a man the Witch-King would fall.
Indeed, claiming the Witch-King died actually breaks a lot, because immediately after that, he went back to Mordor and worked on re-establishing Sauron's empire, and shortly thereafter laid a trap for Earnur and presumably killed him. After which the Stewards ruled Gondor, waiting for Earnur to return. The Witch-King and the other Ringwraiths also took over Minas Ithil and turned it into Minas Morgul and finished off what was left of Osgiliath during that time.