For the sake of an experiment, lets say your git log identifies the following commits
commit 16bc8486fb34cf9a6faf0f7df606ae72ad9ea438 // added
The SHA1 is calculated from the diff and all meta data from this commit (including the author and committer, the timestamp, and various other data).
For your second question, the data commit is still present but not part of any live branch anymore. Sometimes git will run a garbage collection where various deleted stuff will actually be removed. You will notice that once you manually run it using git gc that the unreferenced commit will be gone and not even be accessible with git show anymore.