If I publish a doGet(e) function from a GAS bound to a spreadsheet to create a web app, I can get a handle to the containing spreadsheet by using SpreadsheetApp.getActiveSpreadsheet().
If I give my script all permissions to act as myself and give "everyone" permission to run it, after I close the spreadsheet, a call to SpreadsheetApp.getActiveSpreadsheet() returns null. I am forced to use openById(Id) or openByUrl(Url) with the correct parameter to get the handle.
I assumed there'd been a way to get the container's spreadsheet id from a bound script, otherwise if I wanted to copy a script from a spreadsheet to a new document, I'd have to update the url or the id in the script.