Why moveTo() exists and what it actually does
Google Drive used to allow a file to have multiple parent folders simultaneously. The old pattern was to call file.addToFolder(newFolder) followed by file.removeFromFolder(oldFolder). The problem: if you got the order wrong, or if removeFromFolder threw an exception, the file ended up living in both folders with no error logged. I have watched this bite people who were tidying up processed files in a pipeline — the cleanup step succeeded, the file sat in the original folder for weeks, and nobody noticed until storage was audited.
DriveApp.File.moveTo(destination) was added to the Apps Script Drive service to make this atomic. It sets exactly one parent on the file — the destination folder — and removes all previous parents in the same call. There is no partial state to recover from. The method has been available since the Drive API v3 migration and is the documented replacement for the addToFolder/removeFromFolder pair.
The return type is void; moveTo does not return the file object, so you cannot chain it. If you need a reference to the file after moving, keep the variable you already have — the file object itself remains valid after the move.