Tplkein mentioned that in a letter. Sauron had his ring with him in Numenor and simply carried it back to Mordor while he was in the form of spirit. It was well within his power.
This apparently extends to the Valar, as well: When Fingolfin went up against Morgoth in solo combat, he left him permanently maimed. Again, this might be related to Morgoth being so bent on malice.
I seem to recall Gandalf saying that while Sauron was in the guise of the Necromancer in Dol Gulder he could not yet take physical form, so if he can at the time of the War of the Rings, that’s a fairly recent development.
I have always kind of assumed that Sauron, whatever his immediate goals, was in the long term working to bring back Melkor (Morgoth) from the void.
This belief is based on the passages in the Akallabeth where Sauron essentially proselytizes the “religion of Melkor” to the Numenoreans.
If there is any credence to this theory, it could explain why the Valar found it necessary to send Gandalf and the other members of the Istari to help see that Sauron failed.
I don’t have my Silmarillion in front of me, but I believe Morgoth lost the ability to manipulate his form specifically because of Ungoliant’s attack on him after she had poisoned the Two Trees. IIRC, she absorbed most of Morgoth’s power into herself before
he called the Balrogs down on her.