Why do I see a "Put Back" menu item in the trash for only some items?
You only see Put Back if a file/folder was deleted by the Finder, not any other process.
It will silently fail to Put Back if the folder it came from is gone, but it will still offer.
Tested on Mojave.